• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call java method into jsp file?

 
Eric Tan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone guide me or teach me how can i call the java method into the jsp file? do i need a main method to call it in? or just call the method that i need 2 use only??

below is the coding that i did. one is java and another one is jsp. hope that someone can help me on it. Thanks!!! Really appreciate it.

Country Method.java
[COLOR=SeaGreen]

[/COLOR]
and the jsp.
WebApplication.jsp
[COLOR=SeaGreen][/COLOR]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you don't say what happened when you tried the code, I have to guess that a problem exists because you failed to import the "Test" package in the page import statement.
Bill
[ October 16, 2006: Message edited by: William Brogden ]
 
Eric Tan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that. Here is the error after i tried to run it.


i will look into the info that you suggested. Thanks a lot
 
Arun Kathare
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
U can even use EL
it is as follows ${ClassName/Context sharing rsource.MethodName())
this is a cool one but donot forget to activate EL in Deployment Descriptor or Page header.
 
Anjaneyulu Aerrolla
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

just look at the <%@page import....

i think your missing = there
it should be

<%@page import="com.db4o.ObjectContainer"%>


hope this works
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic