?
Solved

To girinois || TimYates :-)

Posted on 2004-08-18
12
Medium Priority
?
343 Views
Last Modified: 2013-11-24
With reference to my previous Q, Please tell me where i am wrong.
----------------
 My web.xml
----------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
      <filter>
            <filter-name> Filter </filter-name>
            <filter-class>de.grassgmbh.kalendartool.filters.MyFilter</filter-class>
      </filter>
      <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>
</web-app>


------------------------
My struts-config.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>
      <data-sources />
      <form-beans >
            <form-bean name="filterForm" type="de.grassgmbh.kalendartool.form.FilterForm" />
            <form-bean name="registerMaskForm" type="de.grassgmbh.kalendartool.form.RegisterMaskForm" />
            
      </form-beans>

      <global-exceptions />
      <global-forwards />
      <action-mappings >
            <action
                  attribute="filterForm"
                  input="/jsp/ManageCapacity/FilterList.jsp"
                  name="filterForm"
                  path="/filter"
                  scope="request"
                  type="de.grassgmbh.kalendartool.action.FilterAction"
                  unknown="false"
                  validate="false">
                  <forward
                        name="success"
                        path="/jsp/ManageCapacity/ShowList.jsp"
                        redirect="true"
                        contextRelative="false" />
            </action>
            <action
                  attribute="registerMaskForm"
                  input="/jsp/ManageCapacity/RegisterMaskList.jsp"
                  name="registerMaskForm"
                  path="/registerMask"
                  scope="request"
                  type="de.grassgmbh.kalendartool.action.RegisterMaskAction"
                  unknown="false"
                  validate="false">
                  <forward
                        name="reg_success"
                        path="/jsp/ManageCapacity/ShowList.jsp"
                        redirect="true"
                        contextRelative="false" />
            </action>

      </action-mappings>

      <controller
            bufferSize="4096"
            debug="0"
            locale="false"
            nocache="false"
            inputForward="false" />

      <message-resources null="true" parameter="de.grassgmbh.kalendartool.resources" />
      
      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
            <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
      </plug-in>
</struts-config>


Thanks.
0
Comment
Question by:sangeetha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
12 Comments
 
LVL 2

Author Comment

by:sangeetha
ID: 11830505
To give more overview:
----------------------------

KalendarTool
|
|____ src
|           |
|           |___ de.grassgmbh.kalendartool
|           |                   |
|           |                   |____ resources.properties
|           |
|           |___ de.grassgmbh.kalendartool.form
|           |                   |
|           |                   |___ FilterForm.java
|           |                   |___ RegisterMaskForm.java
|           |                  
|           |___ de.grassgmbh.kalendartool.action                  
|           |                   |
|           |                   |___ FilterAction.java
|           |                   |___ RegisterMaskAction.java
|           |
|           |___ de.grassgmbh.kalendartool.filters
|                               |
|                               |___ MyFilter.java
|
|_____ We-Root
               |
               |____ WEB-INF
               |           |
               |           |____ struts-config.xml, web.xml, etc..
               |
               |____ jsp
                           |
                           |____ ManageCapacity
                                            |
                                            |____ FilterList.jsp
                                            |____ RegisterMaskList.jsp
                                            |____ ShowList.jsp



and I have ShowList.jsp as follows:
-----------------------------------------


 ----------------------            -----------------------------
|   FilterList.jsp       |         |  RegisterMaskList.jsp     |
|                           |         |                                    |
 ----------------------            -----------------------------
  ------------------------------------------------------------
|                                                                             |
|                  show the list here                                 |
|                                                                             |
|                                                                             |
  ------------------------------------------------------------
0
 
LVL 35

Accepted Solution

by:
TimYates earned 600 total points
ID: 11830626
You need web.xml like this:

(sorry, I missed a bit out before)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
     <filter>
          <filter-name>Filter</filter-name>
          <filter-class>de.grassgmbh.kalendartool.filters.MyFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.jsp</url-pattern>
     </filter-mapping>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.do</url-pattern>
     </filter-mapping>
     <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>
</web-app>

so that the filter will only be run if you go to a URL with *.jsp or *.do in the filename...

What error are you getting?
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11830702
When i save the web.xml file, it shows the following error in my 'Console' Window:

16:15:59,300 INFO  [TomcatDeployer] undeploy, ctxPath=/KalendarTool, warUrl=file:/C:/Programme/jboss/server/default/deploy/KalendarTool.war/
16:15:59,347 INFO  [TomcatDeployer] deploy, ctxPath=/KalendarTool, warUrl=file:/C:/Programme/jboss/server/default/deploy/KalendarTool.war/
16:15:59,660 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
16:15:59,707 ERROR [Digester] Begin event threw exception
java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)

// blah...blah............

at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
Caused by: java.lang.LinkageError: loader constraints violated when linking org/apache/struts/action/ActionMapping class
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:141)
      at org.apache.struts.config.FormBeanConfig.class$(FormBeanConfig.java:190)
      at org.apache.struts.config.FormBeanConfig.setType(FormBeanConfig.java:190)
      ... 97 more
16:15:59,707 ERROR [ActionServlet] Parsing error processing resource path
java.lang.reflect.InvocationTargetException
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
      at org.apache.commons.digester.Digester.startElement(Digester.java:1276)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1635)

// blah...blah...

16:15:59,722 INFO  [Engine] StandardContext[/KalendarTool]Marking servlet action as unavailable
16:15:59,722 ERROR [Engine] StandardContext[/KalendarTool]Servlet /KalendarTool threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource path
      at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 11830735
have you tried rebooting tomcat?
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11830746
I doubled the points. I have *many* questions to compete with my points. :-D

Thanks for your wnoderful help so far. :-)
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11830807
Yeahh.. i tried, but same result :-(
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 200 total points
ID: 11831046
What I suggest you do is the trial and error technique. For start get rid fo the

<filter>
          <filter-name>Filter</filter-name>
          <filter-class>de.grassgmbh.kalendartool.filters.MyFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.jsp</url-pattern>
     </filter-mapping>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.do</url-pattern>
     </filter-mapping>

part in your web.xml and try again. If it does not fail then the error is somewhere there, defining the filter. Then try to add tags one by one and try again. This will help you identify the problem.
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11835601
0
 
LVL 35

Expert Comment

by:girionis
ID: 11838489
Any updates on this problem? Are you still getting the same error message?
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11896710
sorry for late...it worked after i restart the application and deployed again. thanks for your help.
0
 
LVL 35

Expert Comment

by:girionis
ID: 11899947
:)
0

Featured Post

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question