Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use a bean inside a servlet  RSS feed

 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone tell me if there is a way (what the syntax is) to import and initiate a bean inside a servlet?
Thanks in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be the same as any other Java class.
In our Code Barn, under theServlets section, there are a couple demo applications that instanciate, beans from the servlet, bind them to request scope and then forward to a JSP.

Look for SimpleMVC and SimpleCommand.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!