You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Campbell <mi...@s1.com> on 2000/11/28 00:35:40 UTC

HttpSession.getAttribute() missing?

This is an easy question, I'm sure.

I'm trying to compile my first struts app, and it's blowing up on Action.java not being able to find HttpSession.getAttribute() (in
numerous places; first encountered in Action.java, line 300).  I looked at my HttpSession class and sure enough, it isn't there.

The HttpSession it's going after is in the Jswdk version 1.0.1.    Could it mean putValue() instead?

The HttpSession I have has the following API:

getCreationTime()

getId()

 getLastAccessedTime()

 getMaxInactiveInterval()

 getSessionContext()

 getValue(String)

 getValueNames()

 invalidate()

 isNew()

 putValue(String, Object)

 removeValue(String)

 setMaxInactiveInterval(int)



Re: HttpSession.getAttribute() missing?

Posted by Jim Richards <gr...@cyber4.org>.
Then you've got the wrong .jar file in your classpath, or earlier
in your classpath.

You can either edit your CLASSPATH environment variable setting,
or remove the offending .jar file from your system. You'll then
need to include the correct .jar file (depends on your server
setup) that includes the latest classes.

What server are you using?

> The HttpSession it's going after is in the Jswdk version 1.0.1.    Could it mean putValue() instead?

Re: HttpSession.getAttribute() missing?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
See below.

Mike Campbell wrote:

> > Mike Campbell wrote:
> >
> > > This is an easy question, I'm sure.
> > >
> > > I'm trying to compile my first struts app, and it's blowing up on Action.java not being able to find HttpSession.getAttribute()
> (in
> > > numerous places; first encountered in Action.java, line 300).  I looked at my HttpSession class and sure enough, it isn't there.
> > >
> >
> > The API classes in JSWDK 1.0.1 implement servlet 2.1 and JSP 1.0.  You will need at least servlet 2.2 / JSP 1.1 for Struts to
> work -- I
> > suggest you download Tomcat (3.2 or later) from <http://jakarta.apache.org>.  Among other things, this download includes a
> servlet.jar
> > file with the 2.2/1.1 API classes.
> >
> > Craig McClanahan
>
> Thanks Craig.
>
> in that light, I see also that the tomcat download has:
>  ./lib/ant.jar
> ./lib/jasper.jar
> ./lib/jaxp.jar
> ./lib/parser.jar
> ./lib/servlet.jar
> ./lib/webserver.jar
>
> I'm not using ant, but should I use the jaxp.jar in tomcat in favor of the one the jaxp-1.1ea release by sun?  (And if so, is there
> an equivalent xalan? and crimson.jar?)
>

Tomcat 3.2 is bundled with the libraries from JAXP 1.0 (jaxp.jar and parser.jar).  At that time, no stylesheet processor was included in
JAXP.  You should be able to replace them with the libraries from JAXP 1.1-ea, by removing those two and adding all the JAR files from
the 1.1 release.

>
> Thanks again,
>
> Mike

Craig



Re: HttpSession.getAttribute() missing?

Posted by Mike Campbell <mi...@s1.com>.
> Mike Campbell wrote:
>
> > This is an easy question, I'm sure.
> >
> > I'm trying to compile my first struts app, and it's blowing up on Action.java not being able to find HttpSession.getAttribute()
(in
> > numerous places; first encountered in Action.java, line 300).  I looked at my HttpSession class and sure enough, it isn't there.
> >
>
> The API classes in JSWDK 1.0.1 implement servlet 2.1 and JSP 1.0.  You will need at least servlet 2.2 / JSP 1.1 for Struts to
work -- I
> suggest you download Tomcat (3.2 or later) from <http://jakarta.apache.org>.  Among other things, this download includes a
servlet.jar
> file with the 2.2/1.1 API classes.
>
> Craig McClanahan


Thanks Craig.


in that light, I see also that the tomcat download has:
 ./lib/ant.jar
./lib/jasper.jar
./lib/jaxp.jar
./lib/parser.jar
./lib/servlet.jar
./lib/webserver.jar


I'm not using ant, but should I use the jaxp.jar in tomcat in favor of the one the jaxp-1.1ea release by sun?  (And if so, is there
an equivalent xalan? and crimson.jar?)

Thanks again,

Mike


Re: HttpSession.getAttribute() missing?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Mike Campbell wrote:

> This is an easy question, I'm sure.
>
> I'm trying to compile my first struts app, and it's blowing up on Action.java not being able to find HttpSession.getAttribute() (in
> numerous places; first encountered in Action.java, line 300).  I looked at my HttpSession class and sure enough, it isn't there.
>

The API classes in JSWDK 1.0.1 implement servlet 2.1 and JSP 1.0.  You will need at least servlet 2.2 / JSP 1.1 for Struts to work -- I
suggest you download Tomcat (3.2 or later) from <http://jakarta.apache.org>.  Among other things, this download includes a servlet.jar
file with the 2.2/1.1 API classes.

Craig McClanahan