This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes nullpointerException  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "nullpointerException  " Watch "nullpointerException  " New topic


shekhar john
Ranch Hand

Joined: Feb 02, 2011
Posts: 38
hi to all
i m using struts 2 but i m getting a nullpointerexception which is frustrating me my code is as
please help me to solve the problem .
thanks in advance.

stack trace is :-

Joe Ess

Joined: Oct 29, 2001
Posts: 9126

I fixed your code tags for you.
Your code doesn't match your stack trace (line 40 is blank here). What's on line 40 in the code you are really using?

[How To Ask Questions On JavaRanch]
shekhar john
Ranch Hand

Joined: Feb 02, 2011
Posts: 38
the error is on this code line
String url = request.getRequestURL().toString();

I have pasted one line below from my editor thats why the stack trace shows the error on 40 line
in my code this line is on line 40
know can you please help me to solve it
I agree. Here's the link:
subject: nullpointerException
It's not a secret anymore!