• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

action mapping error in popup window page,help me

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic