Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with some Tips About SWCD.

 
Cristian Daniel Ortiz Cuellar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cristian Daniel Ortiz Cuellar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohitkumar gupta wrote:
.


Thanks Gupta. good answers. God Bless.
 
Cristian Daniel Ortiz Cuellar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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

can somebody explain.
thanks a lot
 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic