Hello
here is my code for Interface
public class LoginApplication implements EntryPoint {
public void onModuleLoad() {
final FormPanel form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.addStyleName("table-center");
form.addStyleName("demo-FormPanel");
VerticalPanel holder = new VerticalPanel();
holder.add(new Label("User ID"));
TextBox userid = new TextBox();
userid.setName("userid");
holder.add(userid);
holder.add(new Label("Password"));
PasswordTextBox passwd = new PasswordTextBox();
passwd.setName("passwd");
holder.add(passwd);
holder.add(new Button("Submit",new ClickListener()
{
public void onClick(
Widget sender) {
form.submit();
}
}
));
form.add(holder);
form.setAction("login");
RootPanel.get().add(form);
}
}
<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>my.pkg.server.Login</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
public class Login extends HttpServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException, IOException {
PrintWriter pw = resp.getWriter();
pw.println("Hello you are in login servlet in get");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException, IOException {
PrintWriter pw = resp.getWriter();
pw.println("Hello you are in login servlet in post");
}
}
when I run this & click on submit button I am not getting any reply
from servlet.. i.e
"Hello you are in login servlet in post"
The url on browser doesn't even change
but in hosted mode it is showing
Starting Jetty on port 8080
jetty-6.1.x
Started [email protected]:8080
304 - GET /LoginApplication.html (127.0.0.1)
304 - GET /LoginApplication.css (127.0.0.1)
304 - GET /loginapplication/loginapplication.nocache.js (127.0.0.1)
304 - GET /loginapplication/clear.cache.gif (127.0.0.1)
304 - GET /loginapplication/hosted.html?loginapplication (127.0.0.1)
304 - GET /loginapplication/gwt/standard/standard.css (127.0.0.1)
304 - GET /loginapplication/gwt/standard/images/hborder.png
(127.0.0.1)
200 - POST /login (127.0.0.1) 40 bytes
in last its showing that it is going to login url but not in browser
any kind of reply.. what does that 40 bytes means ? is it reply from
the server ?
how to solve this ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---