Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

include file Directive not working properly. Variable not resolved in jsp

 
Jaggi Shankarappa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a jsp(lets call it A.jsp) that has a second jsp(lets call it as B.jsp) included using the include directive. I have declared a variable testStr with some default value in it. But when I try to use it in B.jsp, I get the error msg that says, testStr not resolved. I'm using RSA 7.0.0.5. I've included the corresponding jsps' code below.

When I use the same jsp in any other IDE, it works without any problem. Any help is highly appreciated.

Thanks and Regards,
Jaggi


[ March 17, 2008: Message edited by: Jaggi Shankarappa ]

[ March 17, 2008: Message edited by: Jaggi Shankarappa ]
[ March 17, 2008: Message edited by: Jaggi Shankarappa ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am not an expert in JSP but my hunch is that you have testStr in the first JSP and you declare it as a local variable. My guess is testStr's scope is only within the first JSP you wrote.
maybe this might work, but I am not sure

hope this helps
 
Jaggi Shankarappa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. That does not work either.

Thanks,
Jaggi
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Davie Lin:
Hi, I am not an expert in JSP but my hunch is that you have testStr in the first JSP and you declare it as a local variable. My guess is testStr's scope is only within the first JSP you wrote.
maybe this might work, but I am not sure

hope this helps

Bad idea. Hugely, hugely bad idea.

Never ever ever declare variables in a JSP declaration block. Ever.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using RSA 7.0.0.5
I have no idea what RSA is.
 
Jaggi Shankarappa
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RSA is the latest version of J2EE IDE from IBM. You can also call it as WSAD 7
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the problem seems to be confined to a particular IDE, I've moved this to a more appropriate location.
 
Naresh Talluri
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Since the problem seems to be confined to a particular IDE, I've moved this to a more appropriate location.


Can you please let me know why don't we use decalrations in JSP.....
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34401
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Naresh. Talluri's:
Can you please let me know why don't we use decalrations in JSP.....

It is considered bad practice to have any Java code in a JSP. Needing to declare variables puts even more logic into the JSP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic