aspose file tools*
The moose likes JSP and the fly likes Display Java Method Result in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display Java Method Result in JSP" Watch "Display Java Method Result in JSP" New topic
Author

Display Java Method Result in JSP

Eric Tan
Ranch Hand

Joined: Oct 11, 2006
Posts: 72
what is the best way to display the result of the Java Method in JSP?
izzit using javabean or maybe some other method?
i got one whole pile of data stored in the database and i call it out to display in JSP.
how can the JSP call out the method used in Java that display data??
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You don't call servlets methods from JSP to get some data. What you usually do it get some data from the servlet, put it in the request, and forward to a JSP file. You then grab the data from the request. I recommend you to read something about servlets and JSP first.


[My Blog]
All roads lead to JavaRanch
Eric Tan
Ranch Hand

Joined: Oct 11, 2006
Posts: 72
but i cannot use servlets to develop the system. i do not know why my boss doesn't allow. sorry if i ask some not relevant question becoz i m very new in java. so still learning. besides using servlets, can i use javabean or something 2 request out the data??
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Eric Tan,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseRealWords

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"Izzit" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

In answer to your question, yes you can use Javabeans for this.
Explaining all of this is beyond the scope of a webforum.

I suggest picking up a book on Servlets/JSP and working through it before trying to tackle a real commercial app using JSP.
There are also a lot of tutorials on the web.

Binding Javabeans to the various scope objects to make them availaible for use in JSPs is a subject that would be covered in any good JSP book or tutorial.
http://pdf.coreservlets.com/CSAJSP-Chapter13.pdf
Eric Tan
Ranch Hand

Joined: Oct 11, 2006
Posts: 72
sorry about that. i will correct it on my spelling. and thanks again for the info on the javabean. i will look on it. thanks
Mag Yeoh
Ranch Hand

Joined: Oct 08, 2006
Posts: 42
i've tried one of the sample inside the pdf help on javabean that u've posted. but there is still some minor error. could you help me on it? thanks

the codes for java page is



the code of jsp page are

the error message that the eclipse showed me is


hope that you could help on it. thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display Java Method Result in JSP