problem with the method in JSP

<%@ method = "doPost" %> ******* if i remove this statement i am getting output but what is wrong with this statement ********

<HTML>

<HEAD><TITLE>Hello</TITLE></HEAD>

<BODY>

<H1>

<% if (request.getParameter("name") == null) { %>

Hello World

<% } else { %>

Hello, <%= request.getParameter("name") %>

<% } %>

</H1>

</BODY></HTML>

(thank you for the last posted problem solving)

[545 byte] By [chakribobbya] at [2007-10-3 0:20:29]
# 1

There is no <%@ method %> tag for a JSP.

http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html

It looks like you are trying to write a JSP that only accepts post requests - not get?

I'm not sure if you can accomplish that in a JSP directly.

You can with an HttpServlet (which is where the doGet/doPost methods are defined) but HttpJspPage doesn't extend that class necessarily.

Best you could probably do is put in a test of request.getMethod() to see if it is get/post.

evnafetsa at 2007-7-14 17:11:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...