Solved

To girinois || TimYates :-)

Posted on 2004-08-18
12
336 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 150 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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 50 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

695 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