You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kiran Badi <ki...@poonam.org> on 2015/05/11 02:23:30 UTC

Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Hi,

I need to integrate struts 2 with my classic web application based on
servlet.

How do I tell struts 2 intercept only requests coming from specific folder
like

com.mysite.app.xx.yy where I will placing all struts related source files ?

Here is the link what I started at stackoverflow,

http://stackoverflow.com/questions/30056132/integrating-classic-jsp-servlet-3-0-based-web-application-with-struts-2?noredirect=1#comment48258124_30056132

Please see if someone can throw some light on my issue.

-- Kiran Badi

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
Sorry mail got send before I could complete. I have UI Tag lib on top of
the page

<a href="<s:url action="TestStruts.action"></s:url>">Test Page</a>

When i try to deploy, it fails to deploy,I am on struts  2.20 and tomcat
7.0.27 and servlet spec is 3.0 and on windows machines.

SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ourstory]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
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:597)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
at
org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern>
/*.action in filter mapping
at
org.apache.catalina.core.StandardContext.validateFilterMap(StandardContext.java:3019)
at
org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:2968)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1207)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1294)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 37 more
May 11, 2015 12:56:39 PM org.apache.catalina.startup.HostConfig
deployDescriptor
SEVERE: Error deploying configuration descriptor
C:\Users\kiran\AppData\Roaming\NetBeans\7.2.1\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\ourstory.xml
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ourstory]]
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:898)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
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:597)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
at
org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)




On Mon, May 11, 2015 at 12:45 PM, Kiran Badi <ki...@poonam.org> wrote:

> Hi Chris,
>
> Here is Struts 2 filter in web xml,
>
>  <filter>
>         <description>Struts 2 Filter</description>
>         <filter-name>struts2</filter-name>
>
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>     </filter>
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*.action</url-pattern>
>         <dispatcher>REQUEST</dispatcher>
>     </filter-mapping>
>
> Here is test sample with struts.xml which is web-inf/classes folder
>
> <!DOCTYPE struts PUBLIC
>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>     "http://struts.apache.org/dtds/struts-2.0.dtd">
>
> <struts>
>   <constant name="struts.devMode" value="true" />
>   <package name="controller" namespace="/" extends="struts-default">
>       <action name="TestStruts"
> class="org.vasanti.app.helpcommunity.controller.TestStruts"
> method="execute" >
> <result name="success">testdatasource.jsp</result>
> </action>
>     </package>
> </struts>
>
> Here is the test link which I have put in my welcome pag
>
> On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
> Christoph.Nenning@lex-com.net> wrote:
>
>> > I already tried that and it's not working and it fails to deploy to
>> tomcat.
>> >
>>
>>
>> Well, then please give us more details.
>>
>> You may want to have a look here:
>> http://struts.apache.org/docs/home.html
>>
>>
>> Regards,
>> Christoph
>>
>>
>>
>>
>>
>>
>> > On Monday, May 11, 2015, Christoph Nenning
>> <Ch...@lex-com.net>
>> > wrote:
>> >
>> > > > Hi,
>> > > >
>> > > > I need to integrate struts 2 with my classic web application based
>> on
>> > > > servlet.
>> > > >
>> > > > How do I tell struts 2 intercept only requests coming from specific
>> > > folder
>> > > > like
>> > > >
>> > > > com.mysite.app.xx.yy where I will placing all struts related source
>> > > files ?
>> > > >
>> > > > Here is the link what I started at stackoverflow,
>> > > >
>> > > >
>> http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
>> > > > servlet-3-0-based-web-application-with-struts-2?
>> > > > noredirect=1#comment48258124_30056132
>> > > >
>> > > > Please see if someone can throw some light on my issue.
>> > > >
>> > > > -- Kiran Badi
>> > >
>> > >
>> > >
>> > >
>> > > Basically you register struts2 in your web.xml for some url pattern,
>> > > usually *.action. Struts interceptors and actions will only be invoked
>> for
>> > > those URLs.
>> > >
>> > >
>> > >
>> > > Regards,
>> > > Christoph
>> > >
>> > > This Email was scanned by Sophos Anti Virus
>> > >
>>
>> This Email was scanned by Sophos Anti Virus
>>
>
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
Hi All,

I was able to integrate Struts 2 with Classic web application.

Actually It took sometime for me to understand that struts ui tags gets
activated only when request flows through struts filter.My bad stack trace
was showing it all the time, but I never took a look at it. :(

Now I have another query for which I will initiate a separate thread.
Thanks for your time and assistance.Appreciate it.

- Kiran

On Mon, May 11, 2015 at 5:49 PM, Kiran Badi <ki...@poonam.org> wrote:

> No Luck.It loads the page but straight away goes to error page. Let me
> prepare a simple use case and upload it to some public folder.Use case will
> have just 2 links, one with struts and another simple servlet. I cannot use
> exclude param constant since I have lot of servlets using annotations.
>
> On Mon, May 11, 2015 at 1:11 PM, Chris Pratt <th...@gmail.com>
> wrote:
>
>> Try adding namespace="/"to your s:url tag.
>>   (*Chris*)
>> On May 11, 2015 10:06 AM, "Kiran Badi" <ki...@poonam.org> wrote:
>>
>> > Hi Chris, it load app with welcome page with *.action mapping,but seems
>> > like url mapping gets messed up,I get below now.
>> >
>> > <a href="<s:url action="TestStruts.action"></s:url>">Test Page</a></h4>
>> > 164:         </div>
>> > 165:         <!-- End of alert warning container-->
>> > 166:         <hr>
>> >
>> >
>> > Stacktrace:] with root cause
>> > The Struts dispatcher cannot be found.  This is usually caused by using
>> > Struts tags without the associated filter. Struts tags are only usable
>> when
>> > the request has passed through its servlet filter, which initializes the
>> > Struts dispatcher needed for this tag. - [unknown location]
>> > at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
>> > at
>> >
>> >
>> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
>> > at
>> >
>> >
>> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
>> > at
>> org.apache.jsp.index_jsp._jspx_meth_s_005furl_005f0(index_jsp.java:652)
>> > at org.apache.jsp.index_jsp._jspService(index_jsp.java:230)
>> > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>> > at
>> >
>> >
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
>> > at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
>> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
>> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>> > at
>> >
>> >
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>> > at
>> >
>> >
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> > at listener.trimresponse.doFilter(trimresponse.java:43)
>> > at
>> >
>> >
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>> > at
>> >
>> >
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> > at
>> >
>> >
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
>> > at
>> >
>> >
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
>> > at
>> >
>> >
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
>> > at
>> >
>> >
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
>> > at
>> >
>> >
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
>> > at
>> >
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
>> > at
>> >
>> >
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>> > at
>> >
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>> > at
>> >
>> >
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
>> > at
>> >
>> >
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
>> > at
>> >
>> >
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
>> > at
>> >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> > at
>> >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> > at java.lang.Thread.run(Thread.java:619)
>> >
>> >
>> > On Mon, May 11, 2015 at 12:59 PM, Kiran Badi <ki...@poonam.org> wrote:
>> >
>> > > checking chris. I think that should work.Let me check.
>> > >
>> > > On Mon, May 11, 2015 at 12:51 PM, Chris Pratt <
>> thechrispratt@gmail.com>
>> > > wrote:
>> > >
>> > >> If all your URLs aren't at the root (which they probably aren't),
>> you'll
>> > >> want to change your url-pattern to just *.action
>> > >>   (*Chris*)
>> > >>  On May 11, 2015 9:46 AM, "Kiran Badi" <ki...@poonam.org> wrote:
>> > >>
>> > >> > Hi Chris,
>> > >> >
>> > >> > Here is Struts 2 filter in web xml,
>> > >> >
>> > >> >  <filter>
>> > >> >         <description>Struts 2 Filter</description>
>> > >> >         <filter-name>struts2</filter-name>
>> > >> >
>> > >> >
>> > >> >
>> > >>
>> >
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>> > >> >     </filter>
>> > >> >     <filter-mapping>
>> > >> >         <filter-name>struts2</filter-name>
>> > >> >         <url-pattern>/*.action</url-pattern>
>> > >> >         <dispatcher>REQUEST</dispatcher>
>> > >> >     </filter-mapping>
>> > >> >
>> > >> > Here is test sample with struts.xml which is web-inf/classes folder
>> > >> >
>> > >> > <!DOCTYPE struts PUBLIC
>> > >> >     "-//Apache Software Foundation//DTD Struts Configuration
>> 2.0//EN"
>> > >> >     "http://struts.apache.org/dtds/struts-2.0.dtd">
>> > >> >
>> > >> > <struts>
>> > >> >   <constant name="struts.devMode" value="true" />
>> > >> >   <package name="controller" namespace="/"
>> extends="struts-default">
>> > >> >       <action name="TestStruts"
>> > >> > class="org.vasanti.app.helpcommunity.controller.TestStruts"
>> > >> > method="execute" >
>> > >> > <result name="success">testdatasource.jsp</result>
>> > >> > </action>
>> > >> >     </package>
>> > >> > </struts>
>> > >> >
>> > >> > Here is the test link which I have put in my welcome pag
>> > >> >
>> > >> > On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
>> > >> > Christoph.Nenning@lex-com.net> wrote:
>> > >> >
>> > >> > > > I already tried that and it's not working and it fails to
>> deploy
>> > to
>> > >> > > tomcat.
>> > >> > > >
>> > >> > >
>> > >> > >
>> > >> > > Well, then please give us more details.
>> > >> > >
>> > >> > > You may want to have a look here:
>> > >> > > http://struts.apache.org/docs/home.html
>> > >> > >
>> > >> > >
>> > >> > > Regards,
>> > >> > > Christoph
>> > >> > >
>> > >> > >
>> > >> > >
>> > >> > >
>> > >> > >
>> > >> > >
>> > >> > > > On Monday, May 11, 2015, Christoph Nenning
>> > >> > > <Ch...@lex-com.net>
>> > >> > > > wrote:
>> > >> > > >
>> > >> > > > > > Hi,
>> > >> > > > > >
>> > >> > > > > > I need to integrate struts 2 with my classic web
>> application
>> > >> based
>> > >> > > on
>> > >> > > > > > servlet.
>> > >> > > > > >
>> > >> > > > > > How do I tell struts 2 intercept only requests coming from
>> > >> specific
>> > >> > > > > folder
>> > >> > > > > > like
>> > >> > > > > >
>> > >> > > > > > com.mysite.app.xx.yy where I will placing all struts
>> related
>> > >> source
>> > >> > > > > files ?
>> > >> > > > > >
>> > >> > > > > > Here is the link what I started at stackoverflow,
>> > >> > > > > >
>> > >> > > > > >
>> > >> >
>> http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
>> > >> > > > > > servlet-3-0-based-web-application-with-struts-2?
>> > >> > > > > > noredirect=1#comment48258124_30056132
>> > >> > > > > >
>> > >> > > > > > Please see if someone can throw some light on my issue.
>> > >> > > > > >
>> > >> > > > > > -- Kiran Badi
>> > >> > > > >
>> > >> > > > >
>> > >> > > > >
>> > >> > > > >
>> > >> > > > > Basically you register struts2 in your web.xml for some url
>> > >> pattern,
>> > >> > > > > usually *.action. Struts interceptors and actions will only
>> be
>> > >> > invoked
>> > >> > > for
>> > >> > > > > those URLs.
>> > >> > > > >
>> > >> > > > >
>> > >> > > > >
>> > >> > > > > Regards,
>> > >> > > > > Christoph
>> > >> > > > >
>> > >> > > > > This Email was scanned by Sophos Anti Virus
>> > >> > > > >
>> > >> > >
>> > >> > > This Email was scanned by Sophos Anti Virus
>> > >> > >
>> > >> >
>> > >>
>> > >
>> > >
>> >
>>
>
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
No Luck.It loads the page but straight away goes to error page. Let me
prepare a simple use case and upload it to some public folder.Use case will
have just 2 links, one with struts and another simple servlet. I cannot use
exclude param constant since I have lot of servlets using annotations.

On Mon, May 11, 2015 at 1:11 PM, Chris Pratt <th...@gmail.com>
wrote:

> Try adding namespace="/"to your s:url tag.
>   (*Chris*)
> On May 11, 2015 10:06 AM, "Kiran Badi" <ki...@poonam.org> wrote:
>
> > Hi Chris, it load app with welcome page with *.action mapping,but seems
> > like url mapping gets messed up,I get below now.
> >
> > <a href="<s:url action="TestStruts.action"></s:url>">Test Page</a></h4>
> > 164:         </div>
> > 165:         <!-- End of alert warning container-->
> > 166:         <hr>
> >
> >
> > Stacktrace:] with root cause
> > The Struts dispatcher cannot be found.  This is usually caused by using
> > Struts tags without the associated filter. Struts tags are only usable
> when
> > the request has passed through its servlet filter, which initializes the
> > Struts dispatcher needed for this tag. - [unknown location]
> > at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> > at
> >
> >
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
> > at
> >
> >
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
> > at
> org.apache.jsp.index_jsp._jspx_meth_s_005furl_005f0(index_jsp.java:652)
> > at org.apache.jsp.index_jsp._jspService(index_jsp.java:230)
> > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> > at
> >
> >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
> > at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> > at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> > at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> > at listener.trimresponse.doFilter(trimresponse.java:43)
> > at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> > at
> >
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> > at
> >
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
> > at
> >
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
> > at
> >
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
> > at
> >
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
> > at
> >
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> > at
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
> > at
> >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> > at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> > at
> >
> >
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
> > at
> >
> >
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
> > at
> >
> >
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> > at java.lang.Thread.run(Thread.java:619)
> >
> >
> > On Mon, May 11, 2015 at 12:59 PM, Kiran Badi <ki...@poonam.org> wrote:
> >
> > > checking chris. I think that should work.Let me check.
> > >
> > > On Mon, May 11, 2015 at 12:51 PM, Chris Pratt <thechrispratt@gmail.com
> >
> > > wrote:
> > >
> > >> If all your URLs aren't at the root (which they probably aren't),
> you'll
> > >> want to change your url-pattern to just *.action
> > >>   (*Chris*)
> > >>  On May 11, 2015 9:46 AM, "Kiran Badi" <ki...@poonam.org> wrote:
> > >>
> > >> > Hi Chris,
> > >> >
> > >> > Here is Struts 2 filter in web xml,
> > >> >
> > >> >  <filter>
> > >> >         <description>Struts 2 Filter</description>
> > >> >         <filter-name>struts2</filter-name>
> > >> >
> > >> >
> > >> >
> > >>
> >
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
> > >> >     </filter>
> > >> >     <filter-mapping>
> > >> >         <filter-name>struts2</filter-name>
> > >> >         <url-pattern>/*.action</url-pattern>
> > >> >         <dispatcher>REQUEST</dispatcher>
> > >> >     </filter-mapping>
> > >> >
> > >> > Here is test sample with struts.xml which is web-inf/classes folder
> > >> >
> > >> > <!DOCTYPE struts PUBLIC
> > >> >     "-//Apache Software Foundation//DTD Struts Configuration
> 2.0//EN"
> > >> >     "http://struts.apache.org/dtds/struts-2.0.dtd">
> > >> >
> > >> > <struts>
> > >> >   <constant name="struts.devMode" value="true" />
> > >> >   <package name="controller" namespace="/" extends="struts-default">
> > >> >       <action name="TestStruts"
> > >> > class="org.vasanti.app.helpcommunity.controller.TestStruts"
> > >> > method="execute" >
> > >> > <result name="success">testdatasource.jsp</result>
> > >> > </action>
> > >> >     </package>
> > >> > </struts>
> > >> >
> > >> > Here is the test link which I have put in my welcome pag
> > >> >
> > >> > On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
> > >> > Christoph.Nenning@lex-com.net> wrote:
> > >> >
> > >> > > > I already tried that and it's not working and it fails to deploy
> > to
> > >> > > tomcat.
> > >> > > >
> > >> > >
> > >> > >
> > >> > > Well, then please give us more details.
> > >> > >
> > >> > > You may want to have a look here:
> > >> > > http://struts.apache.org/docs/home.html
> > >> > >
> > >> > >
> > >> > > Regards,
> > >> > > Christoph
> > >> > >
> > >> > >
> > >> > >
> > >> > >
> > >> > >
> > >> > >
> > >> > > > On Monday, May 11, 2015, Christoph Nenning
> > >> > > <Ch...@lex-com.net>
> > >> > > > wrote:
> > >> > > >
> > >> > > > > > Hi,
> > >> > > > > >
> > >> > > > > > I need to integrate struts 2 with my classic web application
> > >> based
> > >> > > on
> > >> > > > > > servlet.
> > >> > > > > >
> > >> > > > > > How do I tell struts 2 intercept only requests coming from
> > >> specific
> > >> > > > > folder
> > >> > > > > > like
> > >> > > > > >
> > >> > > > > > com.mysite.app.xx.yy where I will placing all struts related
> > >> source
> > >> > > > > files ?
> > >> > > > > >
> > >> > > > > > Here is the link what I started at stackoverflow,
> > >> > > > > >
> > >> > > > > >
> > >> >
> http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> > >> > > > > > servlet-3-0-based-web-application-with-struts-2?
> > >> > > > > > noredirect=1#comment48258124_30056132
> > >> > > > > >
> > >> > > > > > Please see if someone can throw some light on my issue.
> > >> > > > > >
> > >> > > > > > -- Kiran Badi
> > >> > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > > Basically you register struts2 in your web.xml for some url
> > >> pattern,
> > >> > > > > usually *.action. Struts interceptors and actions will only be
> > >> > invoked
> > >> > > for
> > >> > > > > those URLs.
> > >> > > > >
> > >> > > > >
> > >> > > > >
> > >> > > > > Regards,
> > >> > > > > Christoph
> > >> > > > >
> > >> > > > > This Email was scanned by Sophos Anti Virus
> > >> > > > >
> > >> > >
> > >> > > This Email was scanned by Sophos Anti Virus
> > >> > >
> > >> >
> > >>
> > >
> > >
> >
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Chris Pratt <th...@gmail.com>.
Try adding namespace="/"to your s:url tag.
  (*Chris*)
On May 11, 2015 10:06 AM, "Kiran Badi" <ki...@poonam.org> wrote:

> Hi Chris, it load app with welcome page with *.action mapping,but seems
> like url mapping gets messed up,I get below now.
>
> <a href="<s:url action="TestStruts.action"></s:url>">Test Page</a></h4>
> 164:         </div>
> 165:         <!-- End of alert warning container-->
> 166:         <hr>
>
>
> Stacktrace:] with root cause
> The Struts dispatcher cannot be found.  This is usually caused by using
> Struts tags without the associated filter. Struts tags are only usable when
> the request has passed through its servlet filter, which initializes the
> Struts dispatcher needed for this tag. - [unknown location]
> at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
> at
>
> org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
> at
>
> org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
> at org.apache.jsp.index_jsp._jspx_meth_s_005furl_005f0(index_jsp.java:652)
> at org.apache.jsp.index_jsp._jspService(index_jsp.java:230)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> at
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at listener.trimresponse.doFilter(trimresponse.java:43)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
> at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
> at
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
> at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
> at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
> at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> at
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
> at
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
> at
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
>
>
> On Mon, May 11, 2015 at 12:59 PM, Kiran Badi <ki...@poonam.org> wrote:
>
> > checking chris. I think that should work.Let me check.
> >
> > On Mon, May 11, 2015 at 12:51 PM, Chris Pratt <th...@gmail.com>
> > wrote:
> >
> >> If all your URLs aren't at the root (which they probably aren't), you'll
> >> want to change your url-pattern to just *.action
> >>   (*Chris*)
> >>  On May 11, 2015 9:46 AM, "Kiran Badi" <ki...@poonam.org> wrote:
> >>
> >> > Hi Chris,
> >> >
> >> > Here is Struts 2 filter in web xml,
> >> >
> >> >  <filter>
> >> >         <description>Struts 2 Filter</description>
> >> >         <filter-name>struts2</filter-name>
> >> >
> >> >
> >> >
> >>
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
> >> >     </filter>
> >> >     <filter-mapping>
> >> >         <filter-name>struts2</filter-name>
> >> >         <url-pattern>/*.action</url-pattern>
> >> >         <dispatcher>REQUEST</dispatcher>
> >> >     </filter-mapping>
> >> >
> >> > Here is test sample with struts.xml which is web-inf/classes folder
> >> >
> >> > <!DOCTYPE struts PUBLIC
> >> >     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> >> >     "http://struts.apache.org/dtds/struts-2.0.dtd">
> >> >
> >> > <struts>
> >> >   <constant name="struts.devMode" value="true" />
> >> >   <package name="controller" namespace="/" extends="struts-default">
> >> >       <action name="TestStruts"
> >> > class="org.vasanti.app.helpcommunity.controller.TestStruts"
> >> > method="execute" >
> >> > <result name="success">testdatasource.jsp</result>
> >> > </action>
> >> >     </package>
> >> > </struts>
> >> >
> >> > Here is the test link which I have put in my welcome pag
> >> >
> >> > On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
> >> > Christoph.Nenning@lex-com.net> wrote:
> >> >
> >> > > > I already tried that and it's not working and it fails to deploy
> to
> >> > > tomcat.
> >> > > >
> >> > >
> >> > >
> >> > > Well, then please give us more details.
> >> > >
> >> > > You may want to have a look here:
> >> > > http://struts.apache.org/docs/home.html
> >> > >
> >> > >
> >> > > Regards,
> >> > > Christoph
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > > On Monday, May 11, 2015, Christoph Nenning
> >> > > <Ch...@lex-com.net>
> >> > > > wrote:
> >> > > >
> >> > > > > > Hi,
> >> > > > > >
> >> > > > > > I need to integrate struts 2 with my classic web application
> >> based
> >> > > on
> >> > > > > > servlet.
> >> > > > > >
> >> > > > > > How do I tell struts 2 intercept only requests coming from
> >> specific
> >> > > > > folder
> >> > > > > > like
> >> > > > > >
> >> > > > > > com.mysite.app.xx.yy where I will placing all struts related
> >> source
> >> > > > > files ?
> >> > > > > >
> >> > > > > > Here is the link what I started at stackoverflow,
> >> > > > > >
> >> > > > > >
> >> > http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> >> > > > > > servlet-3-0-based-web-application-with-struts-2?
> >> > > > > > noredirect=1#comment48258124_30056132
> >> > > > > >
> >> > > > > > Please see if someone can throw some light on my issue.
> >> > > > > >
> >> > > > > > -- Kiran Badi
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > Basically you register struts2 in your web.xml for some url
> >> pattern,
> >> > > > > usually *.action. Struts interceptors and actions will only be
> >> > invoked
> >> > > for
> >> > > > > those URLs.
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > Regards,
> >> > > > > Christoph
> >> > > > >
> >> > > > > This Email was scanned by Sophos Anti Virus
> >> > > > >
> >> > >
> >> > > This Email was scanned by Sophos Anti Virus
> >> > >
> >> >
> >>
> >
> >
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
Hi Chris, it load app with welcome page with *.action mapping,but seems
like url mapping gets messed up,I get below now.

<a href="<s:url action="TestStruts.action"></s:url>">Test Page</a></h4>
164:         </div>
165:         <!-- End of alert warning container-->
166:         <hr>


Stacktrace:] with root cause
The Struts dispatcher cannot be found.  This is usually caused by using
Struts tags without the associated filter. Struts tags are only usable when
the request has passed through its servlet filter, which initializes the
Struts dispatcher needed for this tag. - [unknown location]
at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
at
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
at org.apache.jsp.index_jsp._jspx_meth_s_005furl_005f0(index_jsp.java:652)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:230)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at listener.trimresponse.doFilter(trimresponse.java:43)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)


On Mon, May 11, 2015 at 12:59 PM, Kiran Badi <ki...@poonam.org> wrote:

> checking chris. I think that should work.Let me check.
>
> On Mon, May 11, 2015 at 12:51 PM, Chris Pratt <th...@gmail.com>
> wrote:
>
>> If all your URLs aren't at the root (which they probably aren't), you'll
>> want to change your url-pattern to just *.action
>>   (*Chris*)
>>  On May 11, 2015 9:46 AM, "Kiran Badi" <ki...@poonam.org> wrote:
>>
>> > Hi Chris,
>> >
>> > Here is Struts 2 filter in web xml,
>> >
>> >  <filter>
>> >         <description>Struts 2 Filter</description>
>> >         <filter-name>struts2</filter-name>
>> >
>> >
>> >
>> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>> >     </filter>
>> >     <filter-mapping>
>> >         <filter-name>struts2</filter-name>
>> >         <url-pattern>/*.action</url-pattern>
>> >         <dispatcher>REQUEST</dispatcher>
>> >     </filter-mapping>
>> >
>> > Here is test sample with struts.xml which is web-inf/classes folder
>> >
>> > <!DOCTYPE struts PUBLIC
>> >     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>> >     "http://struts.apache.org/dtds/struts-2.0.dtd">
>> >
>> > <struts>
>> >   <constant name="struts.devMode" value="true" />
>> >   <package name="controller" namespace="/" extends="struts-default">
>> >       <action name="TestStruts"
>> > class="org.vasanti.app.helpcommunity.controller.TestStruts"
>> > method="execute" >
>> > <result name="success">testdatasource.jsp</result>
>> > </action>
>> >     </package>
>> > </struts>
>> >
>> > Here is the test link which I have put in my welcome pag
>> >
>> > On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
>> > Christoph.Nenning@lex-com.net> wrote:
>> >
>> > > > I already tried that and it's not working and it fails to deploy to
>> > > tomcat.
>> > > >
>> > >
>> > >
>> > > Well, then please give us more details.
>> > >
>> > > You may want to have a look here:
>> > > http://struts.apache.org/docs/home.html
>> > >
>> > >
>> > > Regards,
>> > > Christoph
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > > On Monday, May 11, 2015, Christoph Nenning
>> > > <Ch...@lex-com.net>
>> > > > wrote:
>> > > >
>> > > > > > Hi,
>> > > > > >
>> > > > > > I need to integrate struts 2 with my classic web application
>> based
>> > > on
>> > > > > > servlet.
>> > > > > >
>> > > > > > How do I tell struts 2 intercept only requests coming from
>> specific
>> > > > > folder
>> > > > > > like
>> > > > > >
>> > > > > > com.mysite.app.xx.yy where I will placing all struts related
>> source
>> > > > > files ?
>> > > > > >
>> > > > > > Here is the link what I started at stackoverflow,
>> > > > > >
>> > > > > >
>> > http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
>> > > > > > servlet-3-0-based-web-application-with-struts-2?
>> > > > > > noredirect=1#comment48258124_30056132
>> > > > > >
>> > > > > > Please see if someone can throw some light on my issue.
>> > > > > >
>> > > > > > -- Kiran Badi
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > Basically you register struts2 in your web.xml for some url
>> pattern,
>> > > > > usually *.action. Struts interceptors and actions will only be
>> > invoked
>> > > for
>> > > > > those URLs.
>> > > > >
>> > > > >
>> > > > >
>> > > > > Regards,
>> > > > > Christoph
>> > > > >
>> > > > > This Email was scanned by Sophos Anti Virus
>> > > > >
>> > >
>> > > This Email was scanned by Sophos Anti Virus
>> > >
>> >
>>
>
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
checking chris. I think that should work.Let me check.

On Mon, May 11, 2015 at 12:51 PM, Chris Pratt <th...@gmail.com>
wrote:

> If all your URLs aren't at the root (which they probably aren't), you'll
> want to change your url-pattern to just *.action
>   (*Chris*)
>  On May 11, 2015 9:46 AM, "Kiran Badi" <ki...@poonam.org> wrote:
>
> > Hi Chris,
> >
> > Here is Struts 2 filter in web xml,
> >
> >  <filter>
> >         <description>Struts 2 Filter</description>
> >         <filter-name>struts2</filter-name>
> >
> >
> >
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
> >     </filter>
> >     <filter-mapping>
> >         <filter-name>struts2</filter-name>
> >         <url-pattern>/*.action</url-pattern>
> >         <dispatcher>REQUEST</dispatcher>
> >     </filter-mapping>
> >
> > Here is test sample with struts.xml which is web-inf/classes folder
> >
> > <!DOCTYPE struts PUBLIC
> >     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> >     "http://struts.apache.org/dtds/struts-2.0.dtd">
> >
> > <struts>
> >   <constant name="struts.devMode" value="true" />
> >   <package name="controller" namespace="/" extends="struts-default">
> >       <action name="TestStruts"
> > class="org.vasanti.app.helpcommunity.controller.TestStruts"
> > method="execute" >
> > <result name="success">testdatasource.jsp</result>
> > </action>
> >     </package>
> > </struts>
> >
> > Here is the test link which I have put in my welcome pag
> >
> > On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
> > Christoph.Nenning@lex-com.net> wrote:
> >
> > > > I already tried that and it's not working and it fails to deploy to
> > > tomcat.
> > > >
> > >
> > >
> > > Well, then please give us more details.
> > >
> > > You may want to have a look here:
> > > http://struts.apache.org/docs/home.html
> > >
> > >
> > > Regards,
> > > Christoph
> > >
> > >
> > >
> > >
> > >
> > >
> > > > On Monday, May 11, 2015, Christoph Nenning
> > > <Ch...@lex-com.net>
> > > > wrote:
> > > >
> > > > > > Hi,
> > > > > >
> > > > > > I need to integrate struts 2 with my classic web application
> based
> > > on
> > > > > > servlet.
> > > > > >
> > > > > > How do I tell struts 2 intercept only requests coming from
> specific
> > > > > folder
> > > > > > like
> > > > > >
> > > > > > com.mysite.app.xx.yy where I will placing all struts related
> source
> > > > > files ?
> > > > > >
> > > > > > Here is the link what I started at stackoverflow,
> > > > > >
> > > > > >
> > http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> > > > > > servlet-3-0-based-web-application-with-struts-2?
> > > > > > noredirect=1#comment48258124_30056132
> > > > > >
> > > > > > Please see if someone can throw some light on my issue.
> > > > > >
> > > > > > -- Kiran Badi
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Basically you register struts2 in your web.xml for some url
> pattern,
> > > > > usually *.action. Struts interceptors and actions will only be
> > invoked
> > > for
> > > > > those URLs.
> > > > >
> > > > >
> > > > >
> > > > > Regards,
> > > > > Christoph
> > > > >
> > > > > This Email was scanned by Sophos Anti Virus
> > > > >
> > >
> > > This Email was scanned by Sophos Anti Virus
> > >
> >
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Chris Pratt <th...@gmail.com>.
If all your URLs aren't at the root (which they probably aren't), you'll
want to change your url-pattern to just *.action
  (*Chris*)
 On May 11, 2015 9:46 AM, "Kiran Badi" <ki...@poonam.org> wrote:

> Hi Chris,
>
> Here is Struts 2 filter in web xml,
>
>  <filter>
>         <description>Struts 2 Filter</description>
>         <filter-name>struts2</filter-name>
>
>
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>     </filter>
>     <filter-mapping>
>         <filter-name>struts2</filter-name>
>         <url-pattern>/*.action</url-pattern>
>         <dispatcher>REQUEST</dispatcher>
>     </filter-mapping>
>
> Here is test sample with struts.xml which is web-inf/classes folder
>
> <!DOCTYPE struts PUBLIC
>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>     "http://struts.apache.org/dtds/struts-2.0.dtd">
>
> <struts>
>   <constant name="struts.devMode" value="true" />
>   <package name="controller" namespace="/" extends="struts-default">
>       <action name="TestStruts"
> class="org.vasanti.app.helpcommunity.controller.TestStruts"
> method="execute" >
> <result name="success">testdatasource.jsp</result>
> </action>
>     </package>
> </struts>
>
> Here is the test link which I have put in my welcome pag
>
> On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
> Christoph.Nenning@lex-com.net> wrote:
>
> > > I already tried that and it's not working and it fails to deploy to
> > tomcat.
> > >
> >
> >
> > Well, then please give us more details.
> >
> > You may want to have a look here:
> > http://struts.apache.org/docs/home.html
> >
> >
> > Regards,
> > Christoph
> >
> >
> >
> >
> >
> >
> > > On Monday, May 11, 2015, Christoph Nenning
> > <Ch...@lex-com.net>
> > > wrote:
> > >
> > > > > Hi,
> > > > >
> > > > > I need to integrate struts 2 with my classic web application based
> > on
> > > > > servlet.
> > > > >
> > > > > How do I tell struts 2 intercept only requests coming from specific
> > > > folder
> > > > > like
> > > > >
> > > > > com.mysite.app.xx.yy where I will placing all struts related source
> > > > files ?
> > > > >
> > > > > Here is the link what I started at stackoverflow,
> > > > >
> > > > >
> http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> > > > > servlet-3-0-based-web-application-with-struts-2?
> > > > > noredirect=1#comment48258124_30056132
> > > > >
> > > > > Please see if someone can throw some light on my issue.
> > > > >
> > > > > -- Kiran Badi
> > > >
> > > >
> > > >
> > > >
> > > > Basically you register struts2 in your web.xml for some url pattern,
> > > > usually *.action. Struts interceptors and actions will only be
> invoked
> > for
> > > > those URLs.
> > > >
> > > >
> > > >
> > > > Regards,
> > > > Christoph
> > > >
> > > > This Email was scanned by Sophos Anti Virus
> > > >
> >
> > This Email was scanned by Sophos Anti Virus
> >
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
Hi Chris,

Here is Struts 2 filter in web xml,

 <filter>
        <description>Struts 2 Filter</description>
        <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*.action</url-pattern>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

Here is test sample with struts.xml which is web-inf/classes folder

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
  <constant name="struts.devMode" value="true" />
  <package name="controller" namespace="/" extends="struts-default">
      <action name="TestStruts"
class="org.vasanti.app.helpcommunity.controller.TestStruts"
method="execute" >
<result name="success">testdatasource.jsp</result>
</action>
    </package>
</struts>

Here is the test link which I have put in my welcome pag

On Mon, May 11, 2015 at 9:07 AM, Christoph Nenning <
Christoph.Nenning@lex-com.net> wrote:

> > I already tried that and it's not working and it fails to deploy to
> tomcat.
> >
>
>
> Well, then please give us more details.
>
> You may want to have a look here:
> http://struts.apache.org/docs/home.html
>
>
> Regards,
> Christoph
>
>
>
>
>
>
> > On Monday, May 11, 2015, Christoph Nenning
> <Ch...@lex-com.net>
> > wrote:
> >
> > > > Hi,
> > > >
> > > > I need to integrate struts 2 with my classic web application based
> on
> > > > servlet.
> > > >
> > > > How do I tell struts 2 intercept only requests coming from specific
> > > folder
> > > > like
> > > >
> > > > com.mysite.app.xx.yy where I will placing all struts related source
> > > files ?
> > > >
> > > > Here is the link what I started at stackoverflow,
> > > >
> > > > http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> > > > servlet-3-0-based-web-application-with-struts-2?
> > > > noredirect=1#comment48258124_30056132
> > > >
> > > > Please see if someone can throw some light on my issue.
> > > >
> > > > -- Kiran Badi
> > >
> > >
> > >
> > >
> > > Basically you register struts2 in your web.xml for some url pattern,
> > > usually *.action. Struts interceptors and actions will only be invoked
> for
> > > those URLs.
> > >
> > >
> > >
> > > Regards,
> > > Christoph
> > >
> > > This Email was scanned by Sophos Anti Virus
> > >
>
> This Email was scanned by Sophos Anti Virus
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Christoph Nenning <Ch...@lex-com.net>.
> I already tried that and it's not working and it fails to deploy to 
tomcat.
> 


Well, then please give us more details.

You may want to have a look here:
http://struts.apache.org/docs/home.html


Regards,
Christoph






> On Monday, May 11, 2015, Christoph Nenning 
<Ch...@lex-com.net>
> wrote:
> 
> > > Hi,
> > >
> > > I need to integrate struts 2 with my classic web application based 
on
> > > servlet.
> > >
> > > How do I tell struts 2 intercept only requests coming from specific
> > folder
> > > like
> > >
> > > com.mysite.app.xx.yy where I will placing all struts related source
> > files ?
> > >
> > > Here is the link what I started at stackoverflow,
> > >
> > > http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> > > servlet-3-0-based-web-application-with-struts-2?
> > > noredirect=1#comment48258124_30056132
> > >
> > > Please see if someone can throw some light on my issue.
> > >
> > > -- Kiran Badi
> >
> >
> >
> >
> > Basically you register struts2 in your web.xml for some url pattern,
> > usually *.action. Struts interceptors and actions will only be invoked 
for
> > those URLs.
> >
> >
> >
> > Regards,
> > Christoph
> >
> > This Email was scanned by Sophos Anti Virus
> >

This Email was scanned by Sophos Anti Virus

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Kiran Badi <ki...@poonam.org>.
I already tried that and it's not working and it fails to deploy to tomcat.

On Monday, May 11, 2015, Christoph Nenning <Ch...@lex-com.net>
wrote:

> > Hi,
> >
> > I need to integrate struts 2 with my classic web application based on
> > servlet.
> >
> > How do I tell struts 2 intercept only requests coming from specific
> folder
> > like
> >
> > com.mysite.app.xx.yy where I will placing all struts related source
> files ?
> >
> > Here is the link what I started at stackoverflow,
> >
> > http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> > servlet-3-0-based-web-application-with-struts-2?
> > noredirect=1#comment48258124_30056132
> >
> > Please see if someone can throw some light on my issue.
> >
> > -- Kiran Badi
>
>
>
>
> Basically you register struts2 in your web.xml for some url pattern,
> usually *.action. Struts interceptors and actions will only be invoked for
> those URLs.
>
>
>
> Regards,
> Christoph
>
> This Email was scanned by Sophos Anti Virus
>

Re: Integrating struts 2 with Classic JSP SERVLET /JSTL webapp

Posted by Christoph Nenning <Ch...@lex-com.net>.
> Hi,
> 
> I need to integrate struts 2 with my classic web application based on
> servlet.
> 
> How do I tell struts 2 intercept only requests coming from specific 
folder
> like
> 
> com.mysite.app.xx.yy where I will placing all struts related source 
files ?
> 
> Here is the link what I started at stackoverflow,
> 
> http://stackoverflow.com/questions/30056132/integrating-classic-jsp-
> servlet-3-0-based-web-application-with-struts-2?
> noredirect=1#comment48258124_30056132
> 
> Please see if someone can throw some light on my issue.
> 
> -- Kiran Badi




Basically you register struts2 in your web.xml for some url pattern, 
usually *.action. Struts interceptors and actions will only be invoked for 
those URLs.



Regards,
Christoph

This Email was scanned by Sophos Anti Virus