Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSP
how to call inner class method or variable from outer jsp?
amir taghvayi
Ranch Hand
Posts: 54
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi
this is my index.jsp page:
<html>
<body>
<%!
public class myclass{
private final int foo = 42;
public int getFoo() {
return foo;
}
}
%>
</body>
</html>
how to call myclass method or variable in other
jsp
page ?
please help me .
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You don't. Firstly, the time to be putting
Java
code in a JSP is long past -- almost 10 years to be exact. Time to move on.
Secondly, even when scriptlets were in vogue, using a JSP for such a purpose was not acceptable. Reusable code belongs in a Java class, not a JSP.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Custom Tag with Body (addition of body content)
I have three ques. about Core Java
How to call a method in action passing a parameter inside jsp with struts 1
TLD jsp
In java there is no problem with forward referencing ?
More...