• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Invoking the spring webproject from gwt web application

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Check out
Window#open()
Window.Location#replace
RequestBuilder
 
Tata Vijay
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Tata Vijay
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic