Advertisement

05.19.2008 at 04:57AM PDT, ID: 23413346
[x]
Attachment Details

jsp servlet question

Asked by pothios in Java Servlets, Java Server Pages (JSP), J2EE

Tags: jsp, servlet

hello, i have a webpage that sends a response to servlet and the servlet will do a getServletContext().getRequestDispatcher("/index.jsp").include(request, response);

in my web.xml, the servlet mapping for my webpage to call the servlet is written below. The problem is, when it redirects the, the url will always be http://localhost:8080/test/login and everything i do a refresh, it calls the servlet.. HTML codes are below






 <servlet-name>login</servlet-name>
    <servlet-class>
          Login
      </servlet-class>
    </servlet>

  <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>/login/*</url-pattern>
  </servlet-mapping>
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index</title>
</head>
<% 
User.User user = (User.User)session.getAttribute("user");
%>
<body>
<p><a href="item.jsp">Items</a></p>
hello <%= user.getId()%>
</body>
</html>
[+][-]05.19.2008 at 05:37AM PDT, ID: 21597172

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Servlets, Java Server Pages (JSP), J2EE
Tags: jsp, servlet
Sign Up Now!
Solution Provided By: ashwanilabs
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.19.2008 at 05:37AM PDT, ID: 21597177

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.19.2008 at 05:40AM PDT, ID: 21597209

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 06:00AM PDT, ID: 21597366

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628