Results 1 to 3 of 3
- 09-20-2009, 09:10 PM #1
Member
- Join Date
- Sep 2009
- Posts
- 2
- Rep Power
- 0
How do I call a class in jsp page
Forgive me for the simple question.
I am not new to Java but I am brand new to JSP and I am having a hard time with some of the basics.
I created a servlet "General" with a class in it called "RandomNumber" which returns an integer.
How can I call this from a JSP page?
Do I need to just create a class as opposed to a servlet?
Thanks for reading and thanks for any help in advance.
Edit:Added info
- 09-20-2009, 10:04 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Your RandomNumber class doesn't need to be inside the Servlet does it?
There are several ways of displaying values in JSPs. A popular approach is to use a bean. Read all about it in Sun's JavaEE tutorial (freely downlodable from the internet)
Just remember never to put Java code inside JSPs.
- 09-20-2009, 10:27 PM #3
Member
- Join Date
- Sep 2009
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
how to call servlet from the very first jsp page
By R O C K Y in forum Advanced JavaReplies: 6Last Post: 07-04-2012, 04:20 PM -
How to call a method from another class?
By jboy in forum New To JavaReplies: 8Last Post: 09-09-2009, 07:29 AM -
NTLM Authentication; cannot call aspx page from java
By getstarted in forum Advanced JavaReplies: 0Last Post: 04-14-2009, 06:39 PM -
How to call a class within a method
By Manfizy in forum New To JavaReplies: 3Last Post: 03-19-2009, 12:34 PM -
Can I call directly the *.class
By doanhanam in forum New To JavaReplies: 1Last Post: 11-16-2008, 07:24 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks