aspose file tools*
The moose likes GWT and the fly likes Invoking the spring webproject from gwt web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Invoking the spring webproject from gwt web application " Watch "Invoking the spring webproject from gwt web application " New topic
Author

Invoking the spring webproject from gwt web application

santhosh karuppaiya
Greenhorn

Joined: Apr 10, 2012
Posts: 6
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

Joined: Jul 26, 2007
Posts: 10255
    
    8

Welcome to the Ranch

Check out
Window#open()
Window.Location#replace
RequestBuilder


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
santhosh karuppaiya
Greenhorn

Joined: Apr 10, 2012
Posts: 6
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

Joined: Jul 26, 2007
Posts: 10255
    
    8

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

Joined: Apr 10, 2012
Posts: 6
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

Joined: Mar 15, 2009
Posts: 452

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


SCJP 5.0 SCWCD 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Invoking the spring webproject from gwt web application