You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ethan Michaels <el...@yahoo.com> on 2003/01/29 03:47:38 UTC

throws NPE

Hi. I'm trying to get a simple link to work on a page.
I use a link tag like this:

<html:link forward="search">Search</html:link>

When I try to load the page using JRun 4, a null
pointer exception shows up in standard output. The
method that thows the exception is

RequestUtils.computeURL()

In my struts-config.xml file, I have

<action
    path="/search"
    type="org.apache.struts.actions.ForwardAction"
    parameter="/search.jsp"/>

The exception message seems to be saying, I guess,
that it's having trouble figuring out the URL to use.
I've tried including an <html:base/> tag at the top of
the page, and defining the <action> differently, for
example...

<action
    path="/search.do"
    type="org.apache.struts.actions.ForwardAction"
    parameter="/search.jsp"/>

<action
    path="search"
    type="org.apache.struts.actions.ForwardAction"
    parameter="/search.jsp"/>

<action
    path="/search"
    type="org.apache.struts.actions.ForwardAction"
    parameter="/newsarchive/search.jsp"/>

Nothing seems to work. I've tried abandonning the link
tag altogether and just explicitly providing the link,
like so:

<a href="/newsarchive/search.do">Search</a>

But then I get an error saying that a GET request is
not supported by this URL.

I would be grateful for any help with this.

Thanks,

Ethan

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


Re: throws NPE

Posted by Keishi Yamashita <yl...@sf.starcat.ne.jp>.
Hi.

Check struts-config.xml syntax.

If syntax errors exist, it may occur.


Keishi.

Ethan Michaels wrote:
> Hi. I'm trying to get a simple link to work on a page.
> I use a link tag like this:
> 
> <html:link forward="search">Search</html:link>
> 
> When I try to load the page using JRun 4, a null
> pointer exception shows up in standard output. The
> method that thows the exception is
> 
> RequestUtils.computeURL()
> 
> In my struts-config.xml file, I have
> 
> <action
>     path="/search"
>     type="org.apache.struts.actions.ForwardAction"
>     parameter="/search.jsp"/>
> 
> The exception message seems to be saying, I guess,
> that it's having trouble figuring out the URL to use.
> I've tried including an <html:base/> tag at the top of
> the page, and defining the <action> differently, for
> example...
> 
> <action
>     path="/search.do"
>     type="org.apache.struts.actions.ForwardAction"
>     parameter="/search.jsp"/>
> 
> <action
>     path="search"
>     type="org.apache.struts.actions.ForwardAction"
>     parameter="/search.jsp"/>
> 
> <action
>     path="/search"
>     type="org.apache.struts.actions.ForwardAction"
>     parameter="/newsarchive/search.jsp"/>
> 
> Nothing seems to work. I've tried abandonning the link
> tag altogether and just explicitly providing the link,
> like so:
> 
> <a href="/newsarchive/search.do">Search</a>
> 
> But then I get an error saying that a GET request is
> not supported by this URL.
> 
> I would be grateful for any help with this.
> 
> Thanks,
> 
> Ethan
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 



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


Re: throws NPE

Posted by Ethan Michaels <el...@yahoo.com>.
--- "David M. Karr" <dm...@earthlink.net> wrote:
> >>>>> "Ethan" == Ethan Michaels
> <el...@yahoo.com> writes:
> 
>     Ethan> Hi. I'm trying to get a simple link to
> work on a page.
>     Ethan> I use a link tag like this:
> 
>     Ethan> <html:link
> forward="search">Search</html:link>

> 
> Please, always, supply exact error messages and the
> entire exception and stack
> trace when describing a problem.  It's unlikely
> anyone can help you if you
> don't show us what happened.


Here is the exception that appeared. As I said, when I
uuse <html:link action="/search.do">Search</html:link>
 it did not cause the exeption, but when I use the
when I try to use the forward or page attributes, the
exception appears.

Ethan



01/28 20:03:35 error 
java.lang.NullPointerException
	at
org.apache.struts.util.RequestUtils.pageURL(RequestUtils.java:1441)
	at
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:456)
	at
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:495)
	at
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
	at
jrun__welcome2ejspc._jspService(jrun__welcome2ejspc.java:69)
	at
jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
	at jrun.jsp.JSPServlet.service(JSPServlet.java:110)
	at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
	at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:226)
	at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
	at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
	at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
	at
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


Re: throws NPE

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Ethan" == Ethan Michaels <el...@yahoo.com> writes:

    Ethan> Hi. I'm trying to get a simple link to work on a page.
    Ethan> I use a link tag like this:

    Ethan> <html:link forward="search">Search</html:link>

    Ethan> When I try to load the page using JRun 4, a null
    Ethan> pointer exception shows up in standard output. The
    Ethan> method that thows the exception is

    Ethan> RequestUtils.computeURL()

    Ethan> In my struts-config.xml file, I have

    Ethan> <action
    Ethan>     path="/search"
    Ethan>     type="org.apache.struts.actions.ForwardAction"
    Ethan>     parameter="/search.jsp"/>

Please, always, supply exact error messages and the entire exception and stack
trace when describing a problem.  It's unlikely anyone can help you if you
don't show us what happened.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




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