Solved

To girinois || TimYates :-)

Posted on 2004-08-18
12
299 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
  • 7
  • 3
  • 2
12 Comments
 
LVL 2

Author Comment

by:sangeetha
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
have you tried rebooting tomcat?
0
 
LVL 2

Author Comment

by:sangeetha
Comment Utility
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
Comment Utility
Yeahh.. i tried, but same result :-(
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 35

Assisted Solution

by:girionis
girionis earned 50 total points
Comment Utility
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
Comment Utility
0
 
LVL 2

Author Comment

by:sangeetha
Comment Utility
0
 
LVL 35

Expert Comment

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

Author Comment

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

Expert Comment

by:girionis
Comment Utility
:)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

744 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now