Sowmeya, please Use Code Tags when you post a source code. That way your code looks formatted. Unformatted code is hard to read. You can add code tags by wrapping your code in [code] [/code] tags. You can edit your message using button and then add code tags to it.
Are you using Struts 2 or 1?? You are using Struts 2 taglib, your configurations and action class is of Struts 1 and the exception is of Struts 2...
So? You can't mix Struts 1 and 2. If you want to use Struts 1 then use it, otherwise use Struts 2. Period...
sowmeya karthik
Greenhorn
Joined: Oct 12, 2010
Posts: 5
posted
0
s i understood that there are many difference in both versions and i am not supposed to combine both.I have changed all the files to struts 1 specific.Thanks
i am getting an exception :
java.lang.NoClassDefFoundError: org/apache/struts2/views/jsp/ui/FormTag
org.apache.jsp.addition_jsp._jspx_meth_html_005fform_005f0(addition_jsp.java:89)
org.apache.jsp.addition_jsp._jspService(addition_jsp.java:67)
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:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
The error says you are still using Struts 2 tags in addition.jsp which as the code shows you are not. Did you deploy your application again properly after removing everything related to Struts 2 (as earlier your JSP had Struts 2 tags used in it)??
sowmeya karthik
Greenhorn
Joined: Oct 12, 2010
Posts: 5
posted
0
S ankit.I was able to rectify the error by making a few changes in my web.xml and jsp files.The program is running properly now,but i have a success.jsp file in which i need to print the sum and i tryed using the bean:write method,but i get an error saying <bean:write >method should be left blank.how do i print the value in success.jsp?I tryed to use request.getAttribute(sum),but it returns a null.I also understand that to make full utilization of the struts framework i am not supposed to touch the session or request to get a value set in the bean.Help me out.
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
posted
0
@Ankit: I believe, we can use Struts2 with Struts1, as far as we know what are we up to. In fact, I tried it in past. But here, its apparent that mixing both will screw up the things, especially for the beginner and who doesn't know what he/she is doing. Hence, I do agree with you here.
@Adeel, I know we can use both versions of Struts in an application, what I meant was one cannot use Struts 2 filter and Struts 1 config files. Mixing it like that is not allowed.
@Sowmeya, can you post the line of success.jsp which is giving you trouble. Also bean:write is not a method, its a tag. Also please don't use the word "S" instead of "Yes". We encourage people to UseRealWords on javaranch...
sowmeya karthik
Greenhorn
Joined: Oct 12, 2010
Posts: 5
posted
0
i was able to get the desired output by using the <bean:write> method in the success.jsp page by setting message-resources in struts-config.xml.Thanks for the help.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.