I just checked both my web.xml and struts-conf.xml. They both look fine
to me but then again this is the first time I am developing a web
program. I mighht not know the correct syntax. However I am pretty
sure that my web.xml and struts-config.xml are correct.
Is there anything missing from my struts-config.xml file or my web.xml
file that would make my webpage throw the NullPointerException?
Here is an updated version of my struts-config.xml and web.xml files
-Paul
________________
struts-conf.xml
________________
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="infoForm" type="forms.InfoForm" />
<form-bean name="menuForm" type="forms.MenuForm" />
</form-beans>
<action-mappings>
<action path="/Info"
type="actions.InfoAction"
name="infoForm"
scope="request">
<forward name="Enter Information"
path="/Web Pages/info.vm"/>
<forward name="done"
path="/Web Pages/menu.vm"/>
</action>
<action path="/Menu"
type="actions.MenuAction"
name="menuForm"
scope="request">
<forward name="enterInfo"
path="/Web Pages/info.vm" />
<forward name="default"
path="/Web Pages/results.vm" />
<forward name="sort"
path="/Web Pages/sort.vm" />
</action>
</action-mappings>
<message-resources parameter="ApplicationResources" />
</struts-config>
_________
web.xml
_________
<?xml version="1.0" encoding="UTF-8"?>
<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>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/conf/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>velocity</servlet-name>
<servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class>
<init-param>
<param-name>org.apache.velocity.toolbox</param-name>
<param-value>/WEB-INF/conf/toolbox.xml</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>velocity</servlet-name>
<url-pattern>*.vm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>info.vm</welcome-file>
</welcome-file-list>
</web-app>
Shinobu Kawai wrote:
Hi Paul,
Here is the Action.java Velocity template and the properties file. If
anyone want's more send me your email address and I'll send you a copy
of it. I don't want my entire code on the web.
Ok, I have a feeling that your Struts is not loaded correctly. Can
you check your configuration files and see if they are correct? In
your original postings, they were not even in xml format. :(
- web.xml
- struts-config.xml
Best regards,
-- Shinobu
--
Shinobu Kawai <[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]