aspose file tools*
The moose likes Servlets and the fly likes jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp" Watch "jsp" New topic
Author

jsp

Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
How to write a function in jsp? and how to call that function?
ex: i want to write
sayHello(){
out.println("hello world");
}
and how to call this function
Somas kanthan
Greenhorn

Joined: Nov 16, 2000
Posts: 8
Hi,
<%! String s = ""; %>
<%!
public String sayHello(){
s = "hello world";
return s;
}
%>

<%= sayHello() %>

Thanks..
Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
even i have tried with code which you have given but still i am not able to call the function helloWorld(); here it is given internal server error
[This message has been edited by vishnu murthy (edited January 08, 2001).]
Preethi Suryam
Ranch Hand

Joined: Nov 17, 2000
Posts: 92
Hi Vishnu!
I have tried the same code and is working fine.why r u not getting it.try it again.
Best Of Luck!
Preethi
Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
Thanks friends,
i got it now


[This message has been edited by vishnu murthy (edited January 11, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp