This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes servlets and Jsp's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets and Jsp Watch "servlets and Jsp New topic
Author

servlets and Jsp's

padmshree Patil
Ranch Hand

Joined: Dec 18, 2000
Posts: 54
Hi,
Thanks. My problem is solved
One more doubt.
In my test.jsp page I have few bottons Back,Next and Finish
When i click on Next it should disply next question.
Can I call jsp method for onclick event?
where i forward it to NextQue servlet it fetches next question
<INPUT TYPE = "BUTTON" NAME ="Back" VALUE ="Back " onclick = 'Backmtd(this)' >
<%!
public void Backmtd()
{ %>
<jsp:forward page="/servlet/NextQue" />
<%! } %>
I tried like this .it's not working.
I am confussed...
please help me out.
thanks,
padmashree

prakash muthu
Ranch Hand

Joined: Sep 06, 2000
Posts: 75
Hi,
Jsp:forward will run in server side. but the general function will execute in client side. so i think you can't use javascript function for JSP work.
let me know if you have any other points.
-Prakash


Prakash.M<BR>Bangalore- India<BR>(prakashem@rediffmail.com)
maheshe
Greenhorn

Joined: Dec 20, 2000
Posts: 2
Even I addressed the same problem .
But now i have solved it.
Call a Java script function onclick event. say refreshmethod() is the Java script method which is called on clicking the button
In a JSP page
<script language="JavaScript">
function refreshmethod()
{
window.location="/refresh.jsp";
}
</script>
<body>
<input type=button onClick="refreshmethod()" ></input>
</body>
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Please note that The Java Ranch has a naming policy, described here and "maheshe" is not a valid name. Please choose one which meets the requirements.
Thanks.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
Consider Paul's rocket mass heater.
 
subject: servlets and Jsp's