Re: How to disable character like Tilt(~) in the Action Name

2016-10-14 Thread R Veach
Why are tilts(~) allowed and enabled by default?
I thought struts would only look for URLs that match the action name in the
config exactly, minus the extension.
Are there other similar characters that struts will allow in the action url?

On Thu, Oct 13, 2016 at 2:01 PM, Lukasz Lenart 
wrote:

> The simplest way is to define an excluded action as follow
>
> 
>
> 2016-10-13 14:00 GMT+02:00 Rajvinder Pal :
> > Hi Everyone,
> >
> > I am trying to access the URL in the browser like below:-
> >
> > 1.) http://localhost:9084/myportal/login.do
> > 2.) http://localhost:9084/myportal/~login.do
> >
> >
> > struts.xml entry:-
> >
> > 
> > 
> > execute
> > 
> > /jsp/userlogin/loginPage.jsp
> > 
> >
> >
> >
> > I am able to get the login page using both the URLs. I don't want to get
> > the result  using second URL. PLease let me know if i need any
> > configuration so that framework should not try to map ~login  to login in
> > the struts.xml
> >
> > Regards,
> > Rajvinder
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Struts 2.3.28.1 NSME

2016-07-21 Thread R Veach
Hi,
I am trying to upgrade from Struts 2.3.24 to 2.3.28.1.
My application was working fine on the old version, but 28 is giving me an
NoSuchMethodError when trying to load a page.
I am using Websphere 8.5 server.

This is the exception and stack trace:
org.apache.tiles.impl.CannotRenderException: ServletException including
path '/jsp/layout/Default-layout.jsp'.
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:692)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:155)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:191)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:372)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:276)
…
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:245)
at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:567)
at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at gov.ssa.security.SecurityFilter.doFilter(SecurityFilter.java:25)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3837)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at
com.ibm.ws390.xmem.proxy.channel.XMemProxySRInboundConnLink.ready(XMemProxySRInboundConnLink.java:105)
at
com.ibm.ws390.xmem.proxy.channel.XMemProxySRInboundChannel.processNewConnection(XMemProxySRInboundChannel.java:123)
at
com.ibm.ws390.xmem.proxy.XMemProxySRCppUtilities.httpinvoke(XMemProxySRCppUtilities.java:150)
at
com.ibm.ws390.orb.ServerRegionBridge.httpinvoke(ServerRegionBridge.java:213)
at
com.ibm.ws390.orb.CommonBridge.getAndProcessWork(CommonBridge.java:680)
at
com.ibm.ws390.orb.CommonBridge.runApplicationThread(CommonBridge.java:611)
at com.ibm.ws.util.ThreadPool$ZOSWorker.run(ThreadPool.java:2098)
Caused by: org.apache.tiles.util.TilesIOException: ServletException
including path '/jsp/layout/Default-layout.jsp'.
at
org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:241)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:243)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
... 57 more
Caused by: java.lang.NoSuchMethodError:
org/apache/tiles/jsp/taglib/InsertAttributeTag.setPageContext(Ljavax/servlet/jsp/PageContext;)V
at
com.ibm._jsp._Default_2D_layout._jspx_meth_tiles_insertAttribute_0(_Default_2D_layout.java:275)
at
com.ibm._jsp._Default_2D_layout._jspService(_Default_2D_layout.java:117)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at
com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)
at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:562)
at 

Change Action Method In Interceptor

2015-03-11 Thread R Veach
Hi,

I know it is possible to limit struts to specific methods using the
MethodFilterInterceptor, and to change the execute method in the config or
form declaration using the method attribute.

Is it possible to have an interceptor change which method would be executed
in the action? I see I can get the method name using
invocation.getProxy().getMethod(), but I can't find any setter.

One reason I want to do this is to build submit and first time in logic
without defining it everywhere for every page and have an interceptor do
the work for me.
I would identify if it is first time or submit based on request to see if
it is GET or POST.
I could call the methods directly from the interceptor since I have the
action instance, but that would bypass the rest of the interceptor chain
and would require this interceptor to always be last in the list.

Here is an example of what I was planning:

//
if (isFirstTime(request)) {
if (action instanceof FirstTimeLogic) {
   invocation.getProxy().setMethod(executeFirstTimeInLogic);
}
} else {
if (action instanceof SubmitLogic) {
invocation.getProxy().setMethod(executeSubmitLogic);
}
}

return invocation.invoke();