P
pmz
Dear Friends,
I was wondering whether it's possible to manage such solution:
1. I create simple servlet (let me call it MyServlet) with all of
those base methods (doPost, doGet, processRequest etc.)
2. I've mapped the servlet in web.xml, as following:
<servlet>
<servlet-name>MyServlet</servlet-name>
<jsp-file>/useServlet.jsp</jsp-file>
</servlet>
3. I'd like to play with database data and pass it into the
userServlet.jsp. I've tried to do it via init() overridden method,
with getServletContext().setAttribute("MyVar", Object), with no use -
the ${MyVar} is pretty empty.
What am I doing wrong? I'm not happy when I need to code HTML with
println() inside the servlet, anyway I've done it before, but I'm not
able to detect what I've forgot or what is missing in my configs.
All the best,
Przemek M. Zawada
I was wondering whether it's possible to manage such solution:
1. I create simple servlet (let me call it MyServlet) with all of
those base methods (doPost, doGet, processRequest etc.)
2. I've mapped the servlet in web.xml, as following:
<servlet>
<servlet-name>MyServlet</servlet-name>
<jsp-file>/useServlet.jsp</jsp-file>
</servlet>
3. I'd like to play with database data and pass it into the
userServlet.jsp. I've tried to do it via init() overridden method,
with getServletContext().setAttribute("MyVar", Object), with no use -
the ${MyVar} is pretty empty.
What am I doing wrong? I'm not happy when I need to code HTML with
println() inside the servlet, anyway I've done it before, but I'm not
able to detect what I've forgot or what is missing in my configs.
All the best,
Przemek M. Zawada