This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes action mapping error in popup window page,help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "action mapping error in popup window page,help me" Watch "action mapping error in popup window page,help me" New topic
Author

action mapping error in popup window page,help me

sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 125
Hi Ranchers,
I have two jsp pages(both jsp pages in the same directory)

i)patientdetails.jsp
ii)uploadpopup.jsp

I have two questions to ask.

question 1
----------
I am getting action mapping error when i am calling a uploadpopup.jsp using window.open from patientdetails.jsp

question 2
----------
if the first problem is rectified,the the appropriate action is called,what i what is ,i have the call the same jsp page(i.e uploadpopup.jsp) and some parameters must be passed to the page,so that based on parameters i will lose the window.


the error for question 1 is..
-----------------------------------
The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Cannot retrieve mapping for action /patientRegistration
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.pd.uploadpopup_jsp._jspService(org.apache.jsp.pd.uploadpopup_jsp:266)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:302)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Cannot retrieve mapping for action /patientRegistration
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:723)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
org.apache.jsp.pd.uploadpopup_jsp._jspService(org.apache.jsp.pd.uploadpopup_jsp:140)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:302)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

--------------------------------

my struts-config file
-------------------------------
<action-mappings>
<action
path="/patientRegistration"
type="patientdemographics.actionservlet.PatientAction"
name="PatientDetailsForm"
scope="request"
validate="true"
parameter="action"
input="/patientregistration.jsp">
<forward name="success" path="/patientregistrationcard.jsp"/>
<forward name="patientdetails" path="/patientdetails.jsp"/>
<forward name="imageuploaded" path="/uploaded.jsp"/>
</action>
<action-mappings>
--------------------------------
patientdetails.jsp
-----------------------------
<script type="text/JavaScript">
<!--
function winpopup()
{
open("<%=root%>/pd/uploadpopup.jsp","","width=500,height=250,scrollbars,statusbar=yes");
}
</script>
----------------------------
uploadpopup.jsp
--------------------------
<html:form method="post" action="/patientRegistration" enctype="multipart/form-data">
<input type="hidden" name="action" value="imageupload"/>
<html:file property="theFile"/>
nbsp; <html:submit>Upload</html:submit>
</html:form>

---------------------------------

help me out ranchers..

Sreenivas
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A problem similar to this was reported in this thread. This individual solved it using JavaScript. I personally don't think it's a good idea to use DispatchAction when uploading files. It looks like this person found a way to make it work, though.

One word of caution: The name "action" has meaning in JavaScript, and therefore should be avoided as the name of an input field. I'd suggest changing the name of your method-indicating parameter to something other than action.
[ March 28, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: action mapping error in popup window page,help me