Forums Register Login

Doubt in a question

+Pie Number of slices to send: Send
In a Sun free ePractice question:


The aswer is letter B... Ok, I agree about that.
But why the letter C is wrong?! The param-value isn't passed with a parameter to the Servlet?
+Pie Number of slices to send: Send
if i'm not wrong, the servlet is initialized only once and get a servletConfig
that contain the name=value pairs of init parameters.
so C is wrong because:
1. only the servletConfig get the name-value parameters.
2. the servlet doesn't get the servletConfig each request, only upon initialization...
+Pie Number of slices to send: Send
Yeas...
I think that you're right. This param is configured at Servlet just at when it is initialized...

Thanks!
+Pie Number of slices to send: Send
Can someone, explain me the next line?

<url-pattern>/shop/*</url-pattern>

what supose to do that?
+Pie Number of slices to send: Send
This url-pattern tells to container how the servlet will be called.

For example:

http://www.mysite.net/shop/action1
http://www.mysite.net/shop/action23
http://www.mysite.net/shop/123

All url's will use the same servlet mapped by servlet-name.
In that case org.myorg.ShoppingServlet.

The actions after the ...shop/ (action1, action23, 123, ...) we can get them in servlet code and use like a flag to choose the action required...
+Pie Number of slices to send: Send
thankyou for the reply
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1220 times.
Similar Threads
Passing web.xml info to servlets
how to use two execute queues for one servlet
Retriving Init Param of a JSP
Extending Weblogics CacheFilter
can any tell what is passed to init() method...
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:46:06.