Search.jsp <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%> <html> <head><title>My Human resources portal - Employee search</title></head> <body> My human resources portal - employee search <hr> <%--<html:form action="/search"> --%> <table> <tr> <td align="right"><bean:message key="label.searchJsp.firstName"/>:</td> <td><input type="text" name="firstName"></td><%-- this tag is working fine but when I replace this tag with the one written below I am not able to run my code --%> <%--<td><html:text property="firstName"/></td> --%> </tr>
Thanks merrill, I have made some changes as you said and I am using struts 1.3.8 version, but what changes should I do it in my web.xml(I think I have to make some changes in <taglib> and struts-config.xml. They are as follows;
web.xml (what should I write in taglib tag now) <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <servlet> <servlet-name>hooha</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
And Merrill, all *.java files are compiled and placed in their respective folders. I need your help again to get out of this bug. I am finding very hard to get over this struts. Although, I am not bad either at jsps and servlets, but I am finding very hard to get over struts. Could you guide me how should I approach over the struts so that I face least problems. Thanks again for your help. regards.
Joined: Feb 15, 2005
Your web.xml file looks OK, except that you need to remove all taglib references.
Are you still getting the same error? If not, please show us the error you're now getting.
In my experience, the best way to begin a struts project is to unzip the struts-blank-1.3.8.war file that comes with the download and use that as the basis for your project. This has all the artifacts you need and templates of the config files. Then just modify the templates to suit your needs.
Another suggestion would be to do a tutorial before jumping into writing your own application. You'll find some good tutorials listed in the Struts wiki.
Joined: Sep 26, 2007
Merrill, Now I am getting this error. I have made all the changes you have said. And removed all taglibs. Type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Module 'null' not found. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs. Apache Tomcat/5.0.28
Joined: Feb 15, 2005
This error is explained in greater detail in question 11 of this forum's FAQ. The real error will be discovered by looking at your System Out log for the period of time when the server is first starting up. The most common problem is an error in parsing the struts-config.xml file due to malformed XML.
I can see one problem immediately: You've declared the wrong DTD in your struts-config.xml file. (version 1.0 instead of 1.3) My suggestion is to unzip the struts-blank-1.3.8.war file that came with the download and use the struts-config.xml file it contains rather than yours. Then just cut and paste your form bean and action mappings into the file.