Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets and Jsp's

 
padmshree Patil
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
maheshe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic