Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Servlets
Servlet not mapping to URL
Bill Clar
Ranch Hand
Posts: 163
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have a
servlet
that is not mapping to my URL:
<servlet-mapping> <servlet-name>view</servlet-name> <url-pattern>/View/*</url-pattern> </servlet-mapping>
When I try to call the Servlet from a
JSP
:
<a href="/View/viewFlow?V1">V1</a>
The resulting link is
http://localhost:9080/View/viewFlow?V1
. It's bypassing the project name. The link should be
http://localhost:9080/TestFlow/View/viewFlow?V1
.
Any suggestions?
Stefan Evans
Bartender
Posts: 1845
10
posted 10 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
You want the FAQ on
Relative Links
That should point you towards injecting the project name into the url like so:
<a href="${pageContext.request.contextPath}/View/viewFlow?V1">V1</a>
An alternative is to use the <c:url> tag which injects it automagically.
<c:url var="viewFlowUrl" value="/View/viewFlow"> <c:param name="V1" value=""/> </c:url> <a href="${viewFlowUrl}">V1</a>
Bill Clar
Ranch Hand
Posts: 163
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Stefan!
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
problem running struts on WebSphere Studio Application Developer Integration 5.0
Cannot Invoke Servlets
getting exception in JSF Tutorial of JR
need help for @RequestMapping
Servlets not working under Tomcat
More...