Click to See Complete Forum and Search --> : Servlet


yogamos
01-05-2006, 09:24 PM
Hi to all memebers of this forum!

I am developing card game in servlet. I have two submit buttons on form on if Quit and other is Help.
1 - If some one clicks quit button, new game should be started
2 - And if clicks help button, the help window will be opened so that user can continue game after closing help window.

Please any one can help me to implement this, I know I have to use session but I need some guide how to make session and how to break it. Does Destroy method breaks session.

I will b thankful if some one helps me.

pera76
01-10-2006, 02:26 AM
You must to mount your page in doGet or doPost or service method with a form with to button.

Example:

public class YourClass extends HttpServlet
{
private HttpSession theSession;
.
.
.
public void service(HttpServletRequest req, HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
{
theSession = req.getSession();
.
.
out.println("<html>");
.
.
out.println("<form>");
.
out.println("<input type='submit' name='ok' value='ok>");
.
out.println("</form>");
.
.
out.println("</html>");
}
}

And so on.

I hope I help you.
Alessandro (sorry for my English)