AnthonyGeorge
Technical User
am attempting the Struts tutorial for struts 1.1
When I try to run the first example I get the following error:
error description: The requested resource (/actions/register1.do) is not available.
The JSP has the following call
<FORM ACTION="../actions/register1.do" METHOD="POST">
This will call the following java class : coreservlets.RegisterAction1
which is mapped in the servletconfig.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC ... >
<struts-config>
<action-mappings>
<action path="/actions/register1"
type="coreservlets.RegisterAction1">
<forward name="success"
path="/WEB-INF/results/result1.jsp"/>
</action>
</action-mappings>
</struts-config>
There is no mention of using a web.xml file so far but I added it so that it could call the tag libries. Should there also me a mapping in the web.xml file I saw a extract from someone who had the same problem to add the following to my web.xml
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
This called the following error:
SEVERE: Parse Error at line 7 column 80: Attribute "types" must be declared for
element type "action".
org.xml.sax.SAXParseException: Attribute "types" must be declared for element t
pe "action".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(U
known Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndVali
ate(Unknown Source)
I know how to write servlets but not actions in the web.xml config file.
Thanks for any help.
Tony
When I try to run the first example I get the following error:
error description: The requested resource (/actions/register1.do) is not available.
The JSP has the following call
<FORM ACTION="../actions/register1.do" METHOD="POST">
This will call the following java class : coreservlets.RegisterAction1
which is mapped in the servletconfig.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC ... >
<struts-config>
<action-mappings>
<action path="/actions/register1"
type="coreservlets.RegisterAction1">
<forward name="success"
path="/WEB-INF/results/result1.jsp"/>
</action>
</action-mappings>
</struts-config>
There is no mention of using a web.xml file so far but I added it so that it could call the tag libries. Should there also me a mapping in the web.xml file I saw a extract from someone who had the same problem to add the following to my web.xml
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
This called the following error:
SEVERE: Parse Error at line 7 column 80: Attribute "types" must be declared for
element type "action".
org.xml.sax.SAXParseException: Attribute "types" must be declared for element t
pe "action".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(U
known Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndVali
ate(Unknown Source)
I know how to write servlets but not actions in the web.xml config file.
Thanks for any help.
Tony