Results 1 to 8 of 8
- 05-26-2011, 10:14 AM #1
How to use request.setAttribute() in JSP?
Hi,
I need to pass a string that s too long from JSP to servlet. What i did was I made one hidden variable and assign that sting in that variable. In servlet i use request.getParameter(). It worked perfectly. Since my string have had some special chars I was not able to request.getParameter.So I used session.setArrribute().NOw it works so fine. But instead of that I need to use request.setAttribute(). When I do this , I am getting NullPointerException in my servelt. Hope you understand Where I stuck. CAn we use req.setAttribute() in Jsp? If So, How.?Mak
(Living @ Virtual World)
- 05-26-2011, 10:20 AM #2
Moved from New to Java
db
- 05-26-2011, 10:26 AM #3
Thanks DarrylBurke. I apologise you for my mistake.
Mak
(Living @ Virtual World)
- 05-26-2011, 12:51 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Can you do us a cutdown version of your problem?
The JSP, the Servlet, the call map (JSP -> client -> Servlet).
I'm trying to figure out what you're up to.
- 05-28-2011, 09:28 AM #5
I have to pass a too long string from JSP to servlet. That s the cut down version of my problem.
Mak
(Living @ Virtual World)
- 05-30-2011, 11:00 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
What's "too long"?
Where is the String coming from?
You aren't giving us much information to go on here.
- 06-01-2011, 09:40 AM #7
that string has 500 chars. It s created in JSP page depends on certain conditions. Did you get enough information.? if not I am ready to explain.
Mak
(Living @ Virtual World)
- 06-01-2011, 10:03 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
problem in understanding request.setAttribute() method
By jnjh in forum New To JavaReplies: 1Last Post: 05-10-2011, 08:10 AM -
multipart request
By nn12 in forum Advanced JavaReplies: 1Last Post: 04-27-2011, 04:47 PM -
How to get / setAttribute from a List with many sql id.
By peace76 in forum Java ServletReplies: 1Last Post: 11-30-2010, 05:08 PM -
Problem with setAttribute()
By R O C K Y in forum Advanced JavaReplies: 7Last Post: 02-09-2009, 01:06 PM -
Difference between Session.setAttribute and System.setProperty
By Kavit Gamot in forum New To JavaReplies: 2Last Post: 01-27-2009, 04:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks