473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem in LookupDispatchAction of Struts

[HTML]

When accessing my JSP I get the following error:
org.apache.jasper.JasperException: Missing message for key "button.add"
my error message
Expand|Select|Wrap|Line Numbers
  1. javax.servlet.ServletException: Missing message for key "button.add"
  2.   org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
  3.   org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
  4.   org.apache.jsp.test1_jsp._jspService(test1_jsp.java:103)
  5.   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
  6.   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  7.   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
  8.   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  9.   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
  10.   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  11.  
my test1.jsp
Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
  3. <%@ page import="java.util.Calendar" %>
  4. <%@ page import="java.util.*" %>
  5. <%@ page import="java.lang.*" %>
  6. <%@ page import="java.text.DecimalFormat" %>
  7. <%@ page import="java.sql.*" %>
  8. <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
  9. <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  10. <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  11. <html>
  12. <body>
  13. <html:form action="/test1" method="get">
  14.     <input type="submit" name="ha1" value="add"/> 
  15.     <input type="submit" name="ha1" value="delete"/>
  16. </html:form>
  17. </body>
  18. </html>
  19.  
my messages.properties
Expand|Select|Wrap|Line Numbers
  1.  
  2. button.add=Add
  3. button.delete=Delete
  4.  
my Action
Expand|Select|Wrap|Line Numbers
  1.  
  2. .....
  3. public class EditAction extends LookupDispatchAction {
  4.  
  5.   private Map map = new HashMap();
  6.   private int addCount;
  7.   private int deleteCount;
  8.   /**
  9.    * Constructor - populate the key method map.
  10.    */
  11.   public EditAction() {
  12.  
  13.     System.out.println("start at Constructor");
  14.     map.put("button.add", "add");
  15.     map.put("button.delete", "delete");
  16.     System.out.println("end at Constructor");
  17.   }
  18.   protected Map getKeyMethodMap() {
  19.     System.out.println("start at getKeyMethodMap");
  20.  
  21.     System.out.println("end at getKeyMethodMap");
  22.     return map;
  23.   }
  24.  
  25.   public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
  26.     throws Exception { 
  27.       // do something here......   
  28.  
  29.       return mapping.findForward("ha"); 
  30.   }
  31.   public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
  32.     throws Exception { // ......   
  33.       // do something here......  
  34.       return mapping.findForward("ha"); 
  35.   }
  36. }
  37.  
my Struts-config.xml
Expand|Select|Wrap|Line Numbers
  1.  
  2. <struts-config>
  3.   <data-sources />  
  4.       <form-bean name="userForm" type="org.apache.struts.action.DynaActionForm">
  5.            <form-property name="testString" type="java.lang.String" />
  6.         </form-bean>
  7.   </form-beans>
  8.   <action-mappings >
  9.    <action path="/test1"  type="test.EditAction" 
  10.            parameter="ha1"
  11.            name="userForm" 
  12.           input="/test1.jsp"
  13.            scope="request" > 
  14.            <!--<exception key="dispatch.ServletException"
  15.                        type="javax.servlet.ServletException"
  16.                        path="/test1.jsp"/> -->        
  17.     <forward  name="ha" path="/test1.jsp" />
  18.   </action>
  19.   </action-mappings>
  20.   <message-resources parameter="MessageResources" />
  21. </struts-config>
  22.  
[/HTML]
Oct 3 '06 #1
0 2234

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Amy | last post by:
When accessing my JSP I get the following error: org.apache.jasper.JasperException: Missing message for key button.next Can anyone tell me what the problem is? I have tried to figure this out...
3
by: Bob Z | last post by:
Hello All, I have a problem I just can't figure out. I am using Oracle's jdeveloper and deploying to a stand-alone linux oc4j server. I have a j2ee/struts application that runs fine from the...
3
by: sancha | last post by:
Hi, i am in a bit of a delima here. I need to submit an action through javascript so i used document.forms.action='/search.do?&submitaction=Add Minus' document.forms.submit(); since i am...
1
by: nithiya sri | last post by:
i am new to struts.I try running struts application in Eclipse with the tomcat plug in .. it shows the following error:; please help me in this... SEVERE: Error loading WebappClassLoader ...
1
by: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. ...
3
by: mayur1 | last post by:
Hello everybody, I am trying to connect to DB2 V 8.1 on Red Hat Linux V5 from WebSphere Application Server V6 on Windows Server 2003. The problem that i am facing is that its not able to opent...
0
rsrinivasan
by: rsrinivasan | last post by:
Hi All, When i run my JSP program, ihave the following exception. How i solve this problem? HTTP Status 500 - ...
1
by: wnaveenkumar | last post by:
package com.trewport.orderprocess.action; import java.io.*; import java.sql.*; import java.util.*; import java.util.Date; import java.lang.Object; import javax.servlet.*; import...
2
raveendrabikkina
by: raveendrabikkina | last post by:
03/17 15:45:40 error Error creating form bean of class epost.form.BpUploadForm java.lang.InstantiationException: epost.form.BpUploadForm at java.lang.Class.newInstance0(Class.java:291) ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.