You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ramya lekha <ra...@gmail.com> on 2008/08/04 17:26:33 UTC

Regarding build.xml for struts application

HI,

I had written a build.xml file for my struts application.. this file creates
a .war file which i can deploy in a tomcat server. I am able to create a
.war file... and wen I deploy it in the server and start calling the
application "servername/proj/index.jsp" i can view the jsp page and wen i
click the link which calls a action (bookList.do). I am getting a error msg
saying "The requested URL /proj/bookList.do was not found on this server."

the directory structure is

webapps/proj/WEB-INF , webapps/proj/jsp
and under WEB-INF i have the files web.xml, struts-config.xml, all struts
tlds files, folders(classes,lib)

my web.xml file is

<?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" version="2.4"
xsi:schemaLocation="http$
  <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/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>3</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

---------------------struts-config.xml------------------


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config$

<struts-config>
  <data-sources />
  <form-beans >
    <form-bean name="bookListForm"
type="com.yourcompany.struts.form.BookListForm" />
    <form-bean name="bookEditForm"
type="com.yourcompany.struts.form.BookEditForm" />
  </form-beans>

  <global-exceptions />
  <global-forwards >


  </global-forwards>

  <action-mappings >

    <action
      attribute="bookListForm"
      input="/WEB-INF/jsp/bookList.jsp"
      name="bookListForm"
      path="/bookList"
      scope="request"
      type="com.yourcompany.struts.action.BookListAction">
      <forward name="showList" path="/WEB-INF/jsp/bookList.jsp" />
    </action>
    <action
      attribute="bookEditForm"
      name="bookEditForm"
      parameter="do"
      path="/bookEdit"
      scope="request"
      type="com.yourcompany.struts.action.BookEditAction">
      <forward name="showEdit" path="/WEB-INF/jsp/bookEdit.jsp" />
      <forward
        name="showList"
        path="/bookList.do"
        redirect="true" />
      <forward name="showAdd" path="/WEB-INF/jsp/bookAdd.jsp" />
    </action>


  </action-mappings>

  <message-resources parameter="com.yourcompany.struts.ApplicationResources"
/>
</struts-config>

Can you please let me know wer is the error...???

Thanks in advance

Ramya

Re: Regarding build.xml for struts application

Posted by Mark Thomas <ma...@apache.org>.
ramya lekha wrote:
<snip/>
> Can you please let me know wer is the error...???

This is a question for the users list.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org