Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Michal Bogdal

Greenhorn
+ Follow
since Mar 04, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michal Bogdal

jami siva wrote:Hi,

In my Servlet, I used below code,

out.println("<html><body");
out.println("<a href=\""+response.encodeURL("/PriceRangeServlet")+ "\"> Click me </a>");
out.println("</body></html>");

In response, when I click on Click me link, I am getting HTTP Status 404 - /PriceRangeServlet because of it is ignoring context path of my application. And in URL, it's shown as http://localhost:8080/PriceRangeServlet
instead of http://localhost:8080/testweb/PriceRangeServlet. Here, testweb is my application name(context name).

Why it is Ignoring context name. If I used RequestDispatcher in Servlet, it is working fine.
What is the difference between these two. And how I fix the above Issue.

Thanks,
Siva



You can also use taglibrary
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...
<c:url value="/PriceRangeServlet" />
...
which add context path to the url and add jsessionid if it is needed
Br
Michal
Hi, Thomas. Could you say something more about your doubts? Both threads use synchronized block on the same common object "director", so only one thread can be inside this block at a time. Besides the methods in "Director" class needn't be synchronized, becouse you call them from synchronized block.
Bye
Hi All, I have done it in following way:


have a nice day
Michal