Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JSP (can not find url)

 
Estefania fanny
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm doing:

public final static void ForwardTo (HttpServletRequest request,
HttpServletResponse response, String url) throws IOException,
ServletException {

RequestDispatcher RequestDispatcher = request.getRequestDispatcher (url);

RequestDispatcher.forward (request, response);

}



But can not find the url, I call it like this:
request.setAttribute ("terminal", terminal);
WebUtil.forwardTo (request, response, "/ ShowTerminal.jsp");


No missing, because I have a similar project, almost equal, and that does the same but it works.
Also without the "/" of ShowTerminal.jsp

thanks
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the error you are getting?
 
Prajakta Acharya
Ranch Hand
Posts: 138
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try prefixing to the URL?
 
Estefania fanny
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There appears no error, is redirected to the home page.

I found that the call does not reach
I have first: FindTerminalForm.jsp with which sent the form with GET to FindTerminalServlet.java that is where I do the prologue of the previous message instruction.

But note that not already FindTerminalServlet.java access.

Thank you very much
Sorry if I explained poorly in English
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found that the call does not reach


Which call does not reach.
 
Estefania fanny
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does not call to FindTerminalServlet.java.


But I'm trying in different ways, and the other I get this error:

jun 11, 2013 5:40:32 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
jun 11, 2013 5:40:43 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() para servlet FindTerminal lanzó excepción
java.lang.NullPointerException
at es.udc.pojo.servjsptutorial.web.FindTerminalServlet.doGet(FindTerminalServlet.java:35)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

It seems that I have something that is null, but I checked that if the object is null Terminal

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic