• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoking the spring webproject from gwt web application

 
santhosh karuppaiya
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need help about gwt..how to invoking the spring project from gwt web application..


thanks in advance by santhosh k
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Check out
Window#open()
Window.Location#replace
RequestBuilder
 
santhosh karuppaiya
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your response..
but your suggestions for clients side only..
i need server side...
gwt web applications project war and spring project war under the web apps folder in tomcat 6..
how to invoking the spring project from gwt application..
kindly help me..awaiting for your response...

thanks in advanse by santhosh k
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh karuppaiya wrote:
but your suggestions for clients side only..

GWT is client side.

For a better answer, you will have to provide us with more information on what exactly you are trying to do here, emphasis on what you mean by "invoking" a spring web project.
TellTheDetails
 
santhosh karuppaiya
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
first thanks for your response..
my problem is how to redirect the spring project from gwt applications..
i have tried the following code,but not working..please help me..
web.xml:
======
<servlet>
<servlet-name>TestServletOne</servlet-name>
<servlet-class>com.san.dyn.servlet.TestServletName</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TestServletOne</servlet-name>
<url-pattern>/sampleproject/test</url-pattern>
</servlet-mapping>


TestServletName.java
==============
public class TestServletName extends HttpServlet {
/**
*
*/
public TestServletName() {
super();
}

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

}

/* (non-Javadoc)
* @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

resp.sendRedirect("/<spring project name>");
System.out.println("=============");


}

}


i have tried above code...resp.sendRedirect("/<spring project name>"); line readed but not redirect to the spring project,
no exception coming...

i have create the TestServletName.java servlet class for redirect to the spring project,
gwt webapps war and spring project war under the webapps folder in tomcat 6 server..

kindly give the any idea redirect the spring project from gwt apps

thanks in advance by santhosh k
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh karuppaiya wrote:hi,
first thanks for your response..
my problem is how to redirect the spring project from gwt applications..
i have tried the following code,but not working..please help me..

i have tried above code...resp.sendRedirect("/<spring project name>"); line readed but not redirect to the spring project,
no exception coming...

i have create the TestServletName.java servlet class for redirect to the spring project,
gwt webapps war and spring project war under the webapps folder in tomcat 6 server..

kindly give the any idea redirect the spring project from gwt apps

thanks in advance by santhosh k


Hi Santosh,

The code you have added here should work. Actually, the only thing which matters here is how you are sending the request to the server. Since the servlet here is a normal HttpServlet ( not RemoteServiceServlet), it should behave properly if you have written Window.open("..../sampleproject/test")

If you are trying to redirect the browser to your spring web app using a RPC call, then simple response.sendRedirect() can't work. This will certainly invoke onFailure() of your callback with a random response code ( 0 in most cases ). You can manually send an error code and can handle it on the GWT client using the following code.



I don't know whether this is a good solution or not but it worked for me a couple of months ago when i was dealing with the same scenario.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic