tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramya lekha" <ramyalekh...@gmail.com>
Subject Regarding build.xml for struts application
Date Mon, 04 Aug 2008 15:26:33 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message