Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » HttpServletRequest cannot be resolved to a type
HttpServletRequest cannot be resolved to a type [message #869473] Thu, 03 May 2012 08:57 Go to next message
Sean Gilley is currently offline Sean Gilley
Messages: 13
Registered: April 2012
Junior Member
Maybe this isn't related to RAP, but the solutions I've tried from the web don't work for one reason or another, and I have a feeling I'm missing something obvious. I'm hoping someone can just answer the question and I can get this handled.

I'm trying to add in the lines to read a parameter passed in via the URL. Right now, I've put in the following test lines:

import org.eclipse.rwt.*;
HttpServletRequest request = RWT.getRequest();
String var1 = request.getParameter( "var1" );
String var2 = request.getParameter( "var2" );

I'm seeing the error:

HttpServletRequest cannot be resolved to a type.

I've done a lot of searching, but nothing I've found resolves the error. I suspect I'm just not importing the right thing, but from my searches it looks like the "right thing" is javax.servlet.*, but while that's in the build path, I can't import it.

Any ideas?

Thanks,

Sean.
Re: HttpServletRequest cannot be resolved to a type [message #869482 is a reply to message #869473] Thu, 03 May 2012 09:06 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 335
Registered: July 2009
Senior Member
Sean,

if with 'importing' you refer to specifying OSGi package-imports, then
you'll also want to import javax.servlet.http. This is the package where
HttpServletRequest is in.

HTH
Rüdiger

On 03.05.2012 14:57, Sean Gilley wrote:
> Maybe this isn't related to RAP, but the solutions I've tried from the
> web don't work for one reason or another, and I have a feeling I'm
> missing something obvious. I'm hoping someone can just answer the
> question and I can get this handled.
>
> I'm trying to add in the lines to read a parameter passed in via the
> URL. Right now, I've put in the following test lines:
>
> import org.eclipse.rwt.*;
> HttpServletRequest request = RWT.getRequest();
> String var1 = request.getParameter( "var1" );
> String var2 = request.getParameter( "var2" );
>
> I'm seeing the error:
>
> HttpServletRequest cannot be resolved to a type.
>
> I've done a lot of searching, but nothing I've found resolves the error.
> I suspect I'm just not importing the right thing, but from my searches
> it looks like the "right thing" is javax.servlet.*, but while that's in
> the build path, I can't import it.
>
> Any ideas?
>
> Thanks,
>
> Sean.
>
--
Rüdiger Herrmann
http://codeaffine.com
Re: HttpServletRequest cannot be resolved to a type [message #869505 is a reply to message #869482] Thu, 03 May 2012 09:49 Go to previous message
Sean Gilley is currently offline Sean Gilley
Messages: 13
Registered: April 2012
Junior Member
Yeah, but I couldn't import it and I couldn't figure out why. Finally a nice person here took pity on me and explained that javax.servlet not only had to be in my bundles, but in my dependencies. That fixed the issue.

Thanks.

Sean.
Previous Topic:Problem with EclipseLink in Tomcat 7 (with RAP bridge)
Next Topic:FileDialog usage questions
Goto Forum:
  


Current Time: Thu May 23 13:15:28 EDT 2013

Powered by FUDForum. Page generated in 0.03095 seconds