Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display Java Method Result in JSP

 
Eric Tan
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eric Tan
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic