Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Wed Jun 18 08:37:29 EDT 2025

Powered by FUDForum. Page generated in 0.07137 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top