aspose file tools*
The moose likes JSP and the fly likes <c:url> not working properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "<c:url> not working properly" Watch "<c:url> not working properly" New topic
Author

<c:url> not working properly

Anil Deshpande
Ranch Hand

Joined: Jan 13, 2008
Posts: 119
I have written two JSP files

index.jsp


and showfirst.jsp


It is throwing me an exception

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


root cause

javax.servlet.ServletException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.showfirst_jsp._jspService(showfirst_jsp.java:85)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


root cause

javax.servlet.jsp.JspTagException
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(Unknown Source)
org.apache.jsp.showfirst_jsp._jspx_meth_c_005fset_005f0(showfirst_jsp.java:173)
org.apache.jsp.showfirst_jsp._jspService(showfirst_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.



I am unable to figure out the problem . What is the problem If I do just<jsp:forward> it works perfectly fine


Anil Deshpande
SCJP 1.5, SCWCD 1.5
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



what is person here if called directly through hyperlink.


request.setAttribute("person",person);


Here you set person as request attribute , hence <jsp:forward> would work fine as it belongs to same request.
Anil Deshpande
Ranch Hand

Joined: Jan 13, 2008
Posts: 119
person is a bean object
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Anil Deshpande wrote:person is a bean object



is it set in session object ? then how could ever server knows its a bean object ?
As said earlier attributes set in request does not get through next request.
Anil Deshpande
Ranch Hand

Joined: Jan 13, 2008
Posts: 119
attributes set in request does not get through next request


One clarification please. Does jsp:forward is diffrent from

Because if I use <jsp:forward> I can access the request scoped attributes
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


Because if I use <jsp:forward> I can access the request scoped attributes


<jsp:forward> uses the same request object and pass it to the forwarded page and it all happens in server , whereas hyperlink is a new request which is originated from client.
Anil Deshpande
Ranch Hand

Joined: Jan 13, 2008
Posts: 119
Sorry for the late reply. Now I got everything. Thanks a lot for clarifying the doubt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <c:url> not working properly