This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Doubt in a question  RSS feed

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 170
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Elton Kuzniewski
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeas...
I think that you're right. This param is configured at Servlet just at when it is initialized...

Thanks!
 
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone, explain me the next line?

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

what supose to do that?
 
Elton Kuzniewski
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankyou for the reply
 
Does this tiny ad smell okay to you?
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!