Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

Servlet mapping

Thread view: 
francan00@yahoo.com - 12 Dec 2007 04:22 GMT
I have a page url like this:
http://servername:8080/test/Data?abc=2&cwe=n

Data is a servlet.

Anyway to map this in web.xml so I can change the name to:
http://servername:8080/test/mynewname

This didnt work:

<servlet>
<servlet-name>Data</servlet-name>
<servlet-class>Data</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Data?abc=2&cwe=n</servlet-name>
<url-pattern>/mynewname</url-pattern>
</servlet-mapping>
Lew - 12 Dec 2007 04:31 GMT
> I have a page url like this:
> http://servername:8080/test/Data?abc=2&cwe=n
[quoted text clipped - 14 lines]
> <url-pattern>/mynewname</url-pattern>
> </servlet-mapping>

You cannot put parameters in a servlet mapping.

You can say

 <servlet-mapping>
 <servlet-name>Data</servlet-name>
 <url-pattern>/mynewname</url-pattern>
 </servlet-mapping>

Signature

Lew

Owen Jacobson - 12 Dec 2007 04:39 GMT
> franca...@yahoo.com wrote:
> > I have a page url like this:
[quoted text clipped - 17 lines]
>
> You cannot put parameters in a servlet mapping.

But you might put either another servlet in front (to generate the
appropriate parameters), add a request filter (likewise), or put
apache in front and use mod_rewrite to change one URL to the other
before your servlet container sees it.

-o


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.