This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Help with some Tips About SWCD. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Help with some Tips About SWCD." Watch "Help with some Tips About SWCD." New topic
Author

Help with some Tips About SWCD.

Cristian Daniel Ortiz Cuellar
Ranch Hand

Joined: Feb 02, 2011
Posts: 81
Hey guys i am getting ready for SCWCD. Please help with some tips.
1). If i have a tag with a attribute set rtexprvalue as true if i create the tag and pass the attribute as literal what would happen? Nothing or a exception.
2). If i have a tag with a attribute set rtexprvalue as false if i create the tag and pass the attribute as a runtime expression what would happen? Nothing or a exception.
(the last question works for custom tags simple tags and tag files in the same behavior or are different for each one)
3). If a have a filter to a servlet. The filter is process to the request only or the filter should filter the response as well.. i am receiving the filtering only to the request and not to the response..

4). If a duplicate the context param as show below.


In tomcat. I am getting the last value(javiut@gmail.com) is this servlet spec or vendor specific.??
5). In Servlet init param the same example as the show in the last question i am getting the first result. Not the overwritten value.. again is this servlet spec or vendor specific behavior.

sorry is this question are stupid or something.

best regards from Venezuela sorry by my poor english.
Cristian Daniel Ortiz Cuellar
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

1). If i have a tag with a attribute set rtexprvalue as true if i create the tag and pass the attribute as literal what would happen? Nothing or a exception.

Code will work,there will be no exception.
If i have a tag with a attribute set rtexprvalue as false if i create the tag and pass the attribute as a runtime expression what would happen? Nothing or a exception.

There will be a exception.

. If a have a filter to a servlet. The filter is process to the request only or the filter should filter the response as well.. i am receiving the filtering only to the request and not to the response

Filter process both the request and reponse.Please post your code,so that we can solve your problem.

4). If a duplicate the context param as show below.
view plaincopy to clipboardprint?



In tomcat. I am getting the last value(javiut@gmail.com) is this servlet spec or vendor specific.??
5). In Servlet init param the same example as the show in the last question i am getting the first result. Not the overwritten value.. again is this servlet spec or vendor specific behavior


I too was suprised when i tried the thing you have posted.
I think fellow ranchers can help us with this situation.


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Cristian Daniel Ortiz Cuellar
Ranch Hand

Joined: Feb 02, 2011
Posts: 81
mohitkumar gupta wrote:
.


Thanks Gupta. good answers. God Bless.
Cristian Daniel Ortiz Cuellar
Ranch Hand

Joined: Feb 02, 2011
Posts: 81


Sometimes i am getting the last value sometimes the first one..

can somebody explain.
thanks a lot
Ram Narayan.M
Ranch Hand

Joined: Jul 11, 2010
Posts: 247

If a have a filter to a servlet. The filter is process to the request only or the filter should filter the response as well.. i am receiving the filtering only to the request and not to the response


Filters can only be used to filter requests not the response... However, before using standard response, You can create a customized HttpServletResponse and pass it on FilterChain which
Servlet uses it...

For e.g., example extracted from HFSJ Book...

In that book, you can get the idea of creating customized response which has capability of compressing the very big response sent to Client.

That is instead of repeating the activity of compressing the response in each servlet code... you can pass it on Customized ServletResponse having OutputStream
capable of compressing it... So that redundant compressing logic can be reduced...


SCJP 6 [SCJP - Old is Gold]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Help with some Tips About SWCD.