You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "David Jencks (JIRA)" <pl...@jakarta.apache.org> on 2004/12/20 09:04:22 UTC
[jira] Created: (PLUTO-91) ActionResponseImpl.sendRedirect should check for valid argument
ActionResponseImpl.sendRedirect should check for valid argument
---------------------------------------------------------------
Key: PLUTO-91
URL: http://nagoya.apache.org/jira/browse/PLUTO-91
Project: Pluto
Type: Bug
Components: portlet container
Versions: Current CVS, 1.0.1-rc1
Reporter: David Jencks
ActionResponseImpl.sendRedirect should have the same argument validity checking as PortletResponseImpl.encodeURL. The patch below has the same effect as the PortletResponseImpl implementation but avoids computing the check conditions twice.
@@ -116,8 +116,10 @@
ResourceURLProvider provider = InformationProviderAccess.getDynamicProvider(getHttpServletRequest()).getResourceURLProvider(getInternalPortletWindow());
if (location.indexOf("://") != -1) {
provider.setAbsoluteURL(location);
+ } else if (location.startsWith("/")) {
+ provider.setFullPath(location);
} else {
- provider.setFullPath(location);
+ throw new IllegalArgumentException("only absolute URLs or full path URIs are allowed, not " + location);
}
location = redirectResponse.encodeRedirectURL(provider.toString());
//redirectResponse.sendRedirect(location);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
Re: Null Pointer exception
Posted by Valerie Lavilla <bm...@yahoo.com>.
this is the stack trace. Thanks:
java.lang.NullPointerException
at
org.apache.pluto.core.impl.PortletSessionImpl.getInternalPortletContext(PortletSessionImpl.java:242)
at
org.apache.pluto.core.impl.PortletSessionImpl.getPortletContext(PortletSessionImpl.java:199)
at
net.carefx.portlet.SurveyPortlet.doView(SurveyPortlet.java:44)
at
javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:250)
at
javax.portlet.GenericPortlet.render(GenericPortlet.java:178)
at
net.carefx.portalContext.portlet.ContextPortlet.render(ContextPortlet.java:722)
at
org.apache.jetspeed.container.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:234)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
at
org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:213)
at
org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:124)
at
org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:103)
--- "David H. DeWolf" <dd...@apache.org> wrote:
> Please provide the stack trace as well.
>
> Thanks,
>
> David
>
> Valerie Lavilla wrote:
> > It's being called in the doView() method. When
> that
> > code is being executed, null pointer exception is
> > being generated. From what I've been told sessions
> > can't return null. If there are no sessions
> defined,
> > it'll create its own. Right? Thanks.
> >
> > --- Ken Ramirez <kr...@TheJavaThinkTank.org>
> wrote:
> >
> >
> >>Need more details...
> >>
> >>1. Where are these calls being made? processAction
> >>or doView
> >>
> >>2. What are the circumstances surrounding the
> call?
> >>Has the user seen a
> >>page with a link and clicked on the link to arrive
> >>at the method that
> >>calls getPortletSession and getPortletContext.
> >>
> >>3. How are you defining the context?
> >>
> >>Thanks,
> >>
> >>Ken
> >>
> >>Valerie Lavilla wrote:
> >>
> >>
> >>>Anybody knows why this returns a NullPointer
> >>>exception? And how to fix it?
> >>>
> >>>PortletSession sess = req.getPortletSession();
> >>>PortletContext ctxt = sess.getPortletContext();
> >>>
> >>>
> >>>
> >>>
> >>>__________________________________
> >>>Do you Yahoo!?
> >>>Yahoo! Mail - 250MB free storage. Do more. Manage
> >>
> >>less.
> >>
> >>>http://info.mail.yahoo.com/mail_250
> >>>
> >>>
> >>
> >>--
> >>
> >
> >
>
*----*----*----*----*----*----*----*----*----*----*----*----
> >
> >>Stay on top of all things to do with JSR-168
> Portlet
> >>and
> >>Portal development by bookmarking the authority on
> >>the
> >>subject: http://community.java.net/portlet
> >>*
> >>* News
> >>* Weblogs
> >>* Community Tips
> >>* Portlet and Portal Projects
> >>* Featured Articles
> >>* And much more
> >>*
> >>
> >
> >
>
*----*----*----*----*----*----*----*----*----*----*----*----
> >
> >>Ken Ramirez
> >>Send mail to:
> mailto://kramirez@TheJavaThinkTank.org
> >>Check out the website:
> >>http://www.TheJavaThinkTank.org
> >>Check out my Blog at:
> >>http://weblogs.java.net/blog/ken_ramirez
> >>
> >
> >
>
*----*----*----*----*----*----*----*----*----*----*----*----
> >
> >>
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > All your favorites on one personal page � Try My
> Yahoo!
> > http://my.yahoo.com
> >
>
__________________________________
Do you Yahoo!?
Jazz up your holiday email with celebrity designs. Learn more.
http://celebrity.mail.yahoo.com
Re: Null Pointer exception
Posted by "David H. DeWolf" <dd...@apache.org>.
Please provide the stack trace as well.
Thanks,
David
Valerie Lavilla wrote:
> It's being called in the doView() method. When that
> code is being executed, null pointer exception is
> being generated. From what I've been told sessions
> can't return null. If there are no sessions defined,
> it'll create its own. Right? Thanks.
>
> --- Ken Ramirez <kr...@TheJavaThinkTank.org> wrote:
>
>
>>Need more details...
>>
>>1. Where are these calls being made? processAction
>>or doView
>>
>>2. What are the circumstances surrounding the call?
>>Has the user seen a
>>page with a link and clicked on the link to arrive
>>at the method that
>>calls getPortletSession and getPortletContext.
>>
>>3. How are you defining the context?
>>
>>Thanks,
>>
>>Ken
>>
>>Valerie Lavilla wrote:
>>
>>
>>>Anybody knows why this returns a NullPointer
>>>exception? And how to fix it?
>>>
>>>PortletSession sess = req.getPortletSession();
>>>PortletContext ctxt = sess.getPortletContext();
>>>
>>>
>>>
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Yahoo! Mail - 250MB free storage. Do more. Manage
>>
>>less.
>>
>>>http://info.mail.yahoo.com/mail_250
>>>
>>>
>>
>>--
>>
>
> *----*----*----*----*----*----*----*----*----*----*----*----
>
>>Stay on top of all things to do with JSR-168 Portlet
>>and
>>Portal development by bookmarking the authority on
>>the
>>subject: http://community.java.net/portlet
>>*
>>* News
>>* Weblogs
>>* Community Tips
>>* Portlet and Portal Projects
>>* Featured Articles
>>* And much more
>>*
>>
>
> *----*----*----*----*----*----*----*----*----*----*----*----
>
>>Ken Ramirez
>>Send mail to: mailto://kramirez@TheJavaThinkTank.org
>>Check out the website:
>>http://www.TheJavaThinkTank.org
>>Check out my Blog at:
>>http://weblogs.java.net/blog/ken_ramirez
>>
>
> *----*----*----*----*----*----*----*----*----*----*----*----
>
>>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page – Try My Yahoo!
> http://my.yahoo.com
>
Re: Null Pointer exception
Posted by Valerie Lavilla <bm...@yahoo.com>.
It's being called in the doView() method. When that
code is being executed, null pointer exception is
being generated. From what I've been told sessions
can't return null. If there are no sessions defined,
it'll create its own. Right? Thanks.
--- Ken Ramirez <kr...@TheJavaThinkTank.org> wrote:
> Need more details...
>
> 1. Where are these calls being made? processAction
> or doView
>
> 2. What are the circumstances surrounding the call?
> Has the user seen a
> page with a link and clicked on the link to arrive
> at the method that
> calls getPortletSession and getPortletContext.
>
> 3. How are you defining the context?
>
> Thanks,
>
> Ken
>
> Valerie Lavilla wrote:
>
> >Anybody knows why this returns a NullPointer
> >exception? And how to fix it?
> >
> >PortletSession sess = req.getPortletSession();
> >PortletContext ctxt = sess.getPortletContext();
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Mail - 250MB free storage. Do more. Manage
> less.
> >http://info.mail.yahoo.com/mail_250
> >
> >
>
> --
>
*----*----*----*----*----*----*----*----*----*----*----*----
> Stay on top of all things to do with JSR-168 Portlet
> and
> Portal development by bookmarking the authority on
> the
> subject: http://community.java.net/portlet
> *
> * News
> * Weblogs
> * Community Tips
> * Portlet and Portal Projects
> * Featured Articles
> * And much more
> *
>
*----*----*----*----*----*----*----*----*----*----*----*----
> Ken Ramirez
> Send mail to: mailto://kramirez@TheJavaThinkTank.org
> Check out the website:
> http://www.TheJavaThinkTank.org
> Check out my Blog at:
> http://weblogs.java.net/blog/ken_ramirez
>
*----*----*----*----*----*----*----*----*----*----*----*----
>
>
__________________________________
Do you Yahoo!?
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com
Re: Null Pointer exception
Posted by Ken Ramirez <kr...@TheJavaThinkTank.org>.
Need more details...
1. Where are these calls being made? processAction or doView
2. What are the circumstances surrounding the call? Has the user seen a
page with a link and clicked on the link to arrive at the method that
calls getPortletSession and getPortletContext.
3. How are you defining the context?
Thanks,
Ken
Valerie Lavilla wrote:
>Anybody knows why this returns a NullPointer
>exception? And how to fix it?
>
>PortletSession sess = req.getPortletSession();
>PortletContext ctxt = sess.getPortletContext();
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - 250MB free storage. Do more. Manage less.
>http://info.mail.yahoo.com/mail_250
>
>
--
*----*----*----*----*----*----*----*----*----*----*----*----
Stay on top of all things to do with JSR-168 Portlet and
Portal development by bookmarking the authority on the
subject: http://community.java.net/portlet
*
* News
* Weblogs
* Community Tips
* Portlet and Portal Projects
* Featured Articles
* And much more
*
*----*----*----*----*----*----*----*----*----*----*----*----
Ken Ramirez
Send mail to: mailto://kramirez@TheJavaThinkTank.org
Check out the website: http://www.TheJavaThinkTank.org
Check out my Blog at: http://weblogs.java.net/blog/ken_ramirez
*----*----*----*----*----*----*----*----*----*----*----*----
Null Pointer exception
Posted by Valerie Lavilla <bm...@yahoo.com>.
Anybody knows why this returns a NullPointer
exception? And how to fix it?
PortletSession sess = req.getPortletSession();
PortletContext ctxt = sess.getPortletContext();
__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250
[jira] Updated: (PLUTO-91) ActionResponseImpl.sendRedirect should check for valid argument
Posted by "David DeWolf (JIRA)" <pl...@jakarta.apache.org>.
[ http://nagoya.apache.org/jira/browse/PLUTO-91?page=history ]
David DeWolf updated PLUTO-91:
------------------------------
Version: 1.0.1-rc2
(was: Current CVS)
Fix Version: 1.0.1-rc3
(was: 1.0.1-rc2)
Updating Fixed version to reflect current cvs.
> ActionResponseImpl.sendRedirect should check for valid argument
> ---------------------------------------------------------------
>
> Key: PLUTO-91
> URL: http://nagoya.apache.org/jira/browse/PLUTO-91
> Project: Pluto
> Type: Bug
> Components: portlet container
> Versions: 1.0.1-rc1, 1.0.1-rc2
> Reporter: David Jencks
> Assignee: David DeWolf
> Fix For: 1.0.1-rc3
>
> ActionResponseImpl.sendRedirect should have the same argument validity checking as PortletResponseImpl.encodeURL. The patch below has the same effect as the PortletResponseImpl implementation but avoids computing the check conditions twice.
> @@ -116,8 +116,10 @@
> ResourceURLProvider provider = InformationProviderAccess.getDynamicProvider(getHttpServletRequest()).getResourceURLProvider(getInternalPortletWindow());
> if (location.indexOf("://") != -1) {
> provider.setAbsoluteURL(location);
> + } else if (location.startsWith("/")) {
> + provider.setFullPath(location);
> } else {
> - provider.setFullPath(location);
> + throw new IllegalArgumentException("only absolute URLs or full path URIs are allowed, not " + location);
> }
> location = redirectResponse.encodeRedirectURL(provider.toString());
> //redirectResponse.sendRedirect(location);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Resolved: (PLUTO-91) ActionResponseImpl.sendRedirect should check for valid argument
Posted by "David DeWolf (JIRA)" <pl...@jakarta.apache.org>.
[ http://nagoya.apache.org/jira/browse/PLUTO-91?page=history ]
David DeWolf resolved PLUTO-91:
-------------------------------
Assign To: David DeWolf
Resolution: Fixed
Fix Version: 1.0.1-rc2
Applied
> ActionResponseImpl.sendRedirect should check for valid argument
> ---------------------------------------------------------------
>
> Key: PLUTO-91
> URL: http://nagoya.apache.org/jira/browse/PLUTO-91
> Project: Pluto
> Type: Bug
> Components: portlet container
> Versions: Current CVS, 1.0.1-rc1
> Reporter: David Jencks
> Assignee: David DeWolf
> Fix For: 1.0.1-rc2
>
> ActionResponseImpl.sendRedirect should have the same argument validity checking as PortletResponseImpl.encodeURL. The patch below has the same effect as the PortletResponseImpl implementation but avoids computing the check conditions twice.
> @@ -116,8 +116,10 @@
> ResourceURLProvider provider = InformationProviderAccess.getDynamicProvider(getHttpServletRequest()).getResourceURLProvider(getInternalPortletWindow());
> if (location.indexOf("://") != -1) {
> provider.setAbsoluteURL(location);
> + } else if (location.startsWith("/")) {
> + provider.setFullPath(location);
> } else {
> - provider.setFullPath(location);
> + throw new IllegalArgumentException("only absolute URLs or full path URIs are allowed, not " + location);
> }
> location = redirectResponse.encodeRedirectURL(provider.toString());
> //redirectResponse.sendRedirect(location);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira