• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

MVC in Visualage ( WTE)

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to test MVC in visualage with a simple application.
I have servlet whichgets the request, adds a String object in session & forwards it to JSP which just displays the Session variable...
here is the code
Controller Servlet
String a= new String("TeStInG MvC .....");
HttpSession s = request.getSession();
s.setAttribute("test",a);

ServletContext sc= getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("/view.jsp");

if (rd != null)
rd.forward(request,response);
View.jsp
String a=(String)session.getAttribute("test");
out.println(a);

View.jsp is in following dir..
D:\Program Files\ibm\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\hosts\default_host\default_app\web
The error i get in console is...
javax.servlet.ServletException: non-HTTP request or response
I dont understand what is goign wrong Plz help...
Nehal.
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the stack trace. It would help.
 
brevity is the soul of wit - shakepeare. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic