M
Marc E
All,
I've been doing exclusively non-web java work for the past 4 years or so
(i.e. backend console-type apps) and now am getting back into the web side.
To work back into it, I pulled out a site i wrote back in 2002 on Tomcat
4.x. It runs fine on Tomcat 5.5, but Eclipse is giving me this error:
"getServletContext() not found". Now, this is with the tomcat 55 runtime in
the build path.
here's a typical line of code it throws on:
HashMap hm =
Queries.addBaby_Milestone(milestone,getServletContext().getInitParameter("dsn"),request);
please pardon the bad coding... i was brand new at this back then
Eclipse is saying Severity "The method getServletContext() is undefined for
the type __2F_BabyPagesOrig_2F_guestbook_2F_guestbookProcess_2E_jsp
BabyPagesOrig/guestbook guestbookProcess.jsp
Now, if i remember correctly, what I was doing was using web.xml to store
init params like the datasource name ("dsn" above) and using them in an
"application"-scoped manner.
My question, really, is this: what's now the preferred method of A) working
with application-level variables and also B) accessing databases in a
configurable way? I'm not so much worried about eclipse yelling at me b/c i
figure the reason is probably that I'm doing something stupid, even if it
does run.
Thanks for any tips getting me up to speed again.
Marc E.
I've been doing exclusively non-web java work for the past 4 years or so
(i.e. backend console-type apps) and now am getting back into the web side.
To work back into it, I pulled out a site i wrote back in 2002 on Tomcat
4.x. It runs fine on Tomcat 5.5, but Eclipse is giving me this error:
"getServletContext() not found". Now, this is with the tomcat 55 runtime in
the build path.
here's a typical line of code it throws on:
HashMap hm =
Queries.addBaby_Milestone(milestone,getServletContext().getInitParameter("dsn"),request);
please pardon the bad coding... i was brand new at this back then
Eclipse is saying Severity "The method getServletContext() is undefined for
the type __2F_BabyPagesOrig_2F_guestbook_2F_guestbookProcess_2E_jsp
BabyPagesOrig/guestbook guestbookProcess.jsp
Now, if i remember correctly, what I was doing was using web.xml to store
init params like the datasource name ("dsn" above) and using them in an
"application"-scoped manner.
My question, really, is this: what's now the preferred method of A) working
with application-level variables and also B) accessing databases in a
configurable way? I'm not so much worried about eclipse yelling at me b/c i
figure the reason is probably that I'm doing something stupid, even if it
does run.
Thanks for any tips getting me up to speed again.
Marc E.