aspose file tools*
The moose likes Websphere and the fly likes  include file Directive not working properly. Variable not resolved in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark " include file Directive not working properly. Variable not resolved in jsp " Watch " include file Directive not working properly. Variable not resolved in jsp " New topic
Author

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

Jaggi Shankarappa
Greenhorn

Joined: Mar 17, 2008
Posts: 3
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

Joined: Jan 10, 2002
Posts: 61652
    
  67

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 .


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
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

Joined: Mar 17, 2008
Posts: 3
Nope. That does not work either.

Thanks,
Jaggi
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

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

Joined: Jan 10, 2002
Posts: 61652
    
  67

I'm using RSA 7.0.0.5
I have no idea what RSA is.
Jaggi Shankarappa
Greenhorn

Joined: Mar 17, 2008
Posts: 3
RSA is the latest version of J2EE IDE from IBM. You can also call it as WSAD 7
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

Since the problem seems to be confined to a particular IDE, I've moved this to a more appropriate location.
Naresh Talluri
Ranch Hand

Joined: Oct 12, 2007
Posts: 115
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

Joined: May 26, 2003
Posts: 30929
    
158

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include file Directive not working properly. Variable not resolved in jsp