atom feed6 messages in org.netbeans.nbusersRe: [nbusers] VWB and request parameters
FromSent OnAttachments
William SaxtonMay 24, 2007 8:51 am 
Craig McClanahanMay 24, 2007 10:52 am 
William SaxtonMay 24, 2007 11:32 am 
Craig McClanahanMay 24, 2007 12:46 pm 
William SaxtonMay 25, 2007 6:15 am 
William SaxtonMay 25, 2007 8:32 am 
Subject:Re: [nbusers] VWB and request parameters
From:William Saxton (sax@gmail.com)
Date:May 25, 2007 6:15:48 am
List:org.netbeans.nbusers

Craig,

I'm not an h/c jsp programmer...I just play one on netbeans ;)

Can you explain how to do this? I'm mucking around with jsp:expression and jsp:declaration tags and I'm having trouble accessing the " currentRow.value[..." variable, setting a new variable with the urlencoded value, and getting that value in the javascript.

-Billl

On 5/24/07, Craig McClanahan <crai@apache.org> wrote:

On 5/24/07, William Saxton <sax@gmail.com> wrote:

Hi Craig,

Thanks. That worked. Sort of. If I type in a browser "modulename=Hello%20World", moduleName gets set to "Hello World". I'm calling the page, however, from within a table in javascript:

src=moduleerrors.jsp?modulename=#{currentRow.value['modulename']}

moduleName gets set to "Hello"...everything after the space is gone.

You need to URL encode the parameter value ... otherwise the space will be treated as the end of the URL. See the javadocs for java.net.URLEncoder.

Any ideas?

On 5/24/07, Craig McClanahan <crai@apache.org> wrote:

On 5/24/07, William Saxton <sax@gmail.com> wrote:

Pretty simple prerender method for the moduleerrors.jsp:

public void prerender() { try { String moduleName = getValue("#{requestScope.modulename}").toString(); } catch (Exception e) { e.printStackTrace(); } }

When I try to access:

moduleerrors.jsp?modulename=foo

I get a null pointer exception because getValue("#{requestScope.modulename }") is returning a null value

This seems real simple. Any ideas what I might be doing wrong?

Yep. You are trying to access a request *parameter*, but requestScope references a request *attribute*. Try this instead:

getValue("#{param.modulename}");