You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Sanjeev Vijapurapu <SV...@WSGC.com> on 2008/01/31 21:16:42 UTC

Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1

Hi,

I have recently upgraded to struts 2.1.1 and if my struts filter
dispatcher url pattern is not "/*" instead it is "/actions/*,
/struts/*".

And now if I am trying to access a jsp page that is not under that url
pattern ( something like /test.jsp), struts tags in that jsp page fail.

I get the following stack trace

 

java.lang.NullPointerException
        at
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:55)
        at
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTag
Support.java:46)
        at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTag
Support.java:47)
        at
org.apache.jsp.test_jsp._jspx_meth_sx_head_0(org.apache.jsp.test_jsp:95)
        at
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:65)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:373)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 
So does this mean that if my jsp is using struts tags, it has to go
through filter dispatcher?
 
Thanks

 


Re: Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1

Posted by Al Sutton <al...@alsutton.com>.
As a first side note S2.1.1 hasn't been released, so you're either using the 
very old S2.1.0 snapshot, or you're using the latest from the Subversion 
repository.

Most of the tags in S2.1 need the stack due to the way they are rendered, if 
you are using any tags you should have the filter in place because many of 
them either use defaults from the stack in order to render correctly, or 
some (as is the case for sx:head) set default values in the stack to control 
how other tags are rendered.

Al.

----- Original Message ----- 
From: "Sanjeev Vijapurapu" <SV...@WSGC.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, January 31, 2008 9:48 PM
Subject: RE: Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1


That's what I thought but why does tags need stack when I am not
accessing any of the values. It just has sx:head.
So my question is am I right in saying that struts should be able to
render struts tags as it does jstl tags without worrying abt any stack.
If stack is null, it should treat it as an empty stack rather than
throwing null pointer.

Thanks


-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com]
Sent: Thursday, January 31, 2008 1:33 PM
To: Struts Users Mailing List
Subject: Re: Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1

--- Sanjeev Vijapurapu <SV...@WSGC.com> wrote:
> So does this mean that if my jsp is using struts tags, it has to go
> through filter dispatcher?

The filter is what puts the stack into scope so the tags have data to
access
(more or less).

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1

Posted by Sanjeev Vijapurapu <SV...@WSGC.com>.
That's what I thought but why does tags need stack when I am not
accessing any of the values. It just has sx:head. 
So my question is am I right in saying that struts should be able to
render struts tags as it does jstl tags without worrying abt any stack.
If stack is null, it should treat it as an empty stack rather than
throwing null pointer.

Thanks

 
-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com] 
Sent: Thursday, January 31, 2008 1:33 PM
To: Struts Users Mailing List
Subject: Re: Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1

--- Sanjeev Vijapurapu <SV...@WSGC.com> wrote:
> So does this mean that if my jsp is using struts tags, it has to go
> through filter dispatcher?

The filter is what puts the stack into scope so the tags have data to
access
(more or less).

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts tags and Filter Dispatcher Url Pattern-struts 2.1.1

Posted by Dave Newton <ne...@yahoo.com>.
--- Sanjeev Vijapurapu <SV...@WSGC.com> wrote:
> So does this mean that if my jsp is using struts tags, it has to go
> through filter dispatcher?

The filter is what puts the stack into scope so the tags have data to access
(more or less).

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org