Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Jay Reddy

Greenhorn
+ Follow
since Apr 18, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jay Reddy

Merrill,
Thank you very much.
The application is working fine after I removed (.properteis) suffix in the struts-config.xml file.
JAY
12 years ago
Merril Thanks a lot.
I fixed the Action mapping issue based on Struts-FAQs 13 you suggested.
But still uable to display the values of the keys

----------Bean:message is displaying(key names, not the values):

???en_US.prompt.customer.firstname??? ???en_US.prompt.customer.lastname???
???en_US.button.submitt???
???en_US.button.cancel???

----------in the properties file:
prompt.customer.firstname=First Namelabel
prompt.customer.lastname=Last Namelabel
button.submit= Submit ME
button.cancel= Cancel ME

----------Stuts-config.xml:
<message-resources parameter="com/main/MessageResources.properties" null="false" />

-------------- JSP
<html:form action="submitCustomerForm2.do" method="POST">

<bean:message key= "prompt.customer.firstname"/>
<html:text property="firstName"/>

<bean:message key= "prompt.customer.lastname"/>
<html:text property="lastName"/>

<html:submit>
<bean:message key= "button.submit" />
</html:submit>

<html:cancel>
<bean:message key= "button.cancel" />
</html:cancel>

</html:form>


Thanks,
Jay
12 years ago
Mahmoud, here is the JSP code:

//----------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html:html>
<head> <html:base/> </head>
<html:errors/>
<body>
(- tags-no ) This is custoemrformDetails2-jsp

<html:form action="submitCustomerForm2.do" method="POST">

<bean:message key= "prompt.customer.firstname"/>
<html:text property="firstName"/>

<bean:message key= "prompt.customer.lastname"/>
<html:text property="lastName"/>

<html:submit>
<bean:message key= "button.submit" />
</html:submit>

<html:cancel>
<bean:message key= "button.cancel" />
</html:cancel>

</html:form>

</body>
</html:html>
//-------------------------- Error message


Apr 23, 2008 10:00:48 PM org.mortbay.jetty.servlet.ServletHandler handle
WARNING: EXCEPTION
org.apache.jasper.JasperException: Exception in JSP: /customerDetails2.jsp:14

11: <body>
12: (- tags-no ) This is custoemrformDetails2-jsp
13:
14: <html:form action="submitCustomerForm2.do" method="POST">
15:
16: <bean:message key= "prompt.customer.firstname"/>
17: <html:text property="firstName"/>


Stacktrace:
Stacktrace:
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
...
WARNING: EXCEPTION
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
at org.apache.jsp.customerDetails2_jsp._jspService(customerDetails2_jsp.java:94)
12 years ago
<bean:message> tag is not working
(<html:link > is also not working either)


--------------------------ENVIRNOMENT
Eclipse Version: 3.3.2 (J2EE Preview server)
jakarta-struts-1.2.2
jre1.6.0 (1.5? in the build path)


--------------------------struts-config.xml
.....
<message-resources parameter="/com.main.MessageResources.properties" null="false" />

</struts-config>


KEY in the (MessageResources.properties) file:
prompt.customer.firstname=First Namelabel

-------------------------- web.xml
...
<jsp-config>

<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld </taglib-location>
</taglib>
.......
</jsp-config>


</web-app>

-------------------------- error message:
Apr 19, 2008 5:09:46 PM org.mortbay.jetty.servlet.ServletHandler handle
WARNING: EXCEPTION
org.apache.jasper.JasperException: Exception in JSP: /customerDetails.jsp:19

16:
17: <form name="custFrom" action= "/Struts1/submitCustomerForm.do" />
19: <bean:message key="prompt.customer.firstname"/>:
<!-- the below normal html tag works fine-->

First name: <input type="text" name="firsttName" calue = "">
<input type="text" name="firstName" value ="" />
12 years ago