Monday, January 28, 2008

Write Web application using only one Servlet!

What do you think?...not a good idea? Then what Front Controller Framework like Struts does?

(NOTE: All Jsps in your web app gets converted into Servlets!...but don't worry for that.)

In FC framework, you have only one servlet and all the requests are dispatched to the proper Action Classes based on the mapping in your struts-config.xml.

Let me write my own FrontController..I am not going to use any .xml file..I will be hardcoding :-)

Public class MyFrontControllerServlet{

public void execute()
{
if(requestparam == 'add') {

Call ActionClass1();

}
else if (requestparam == 'delete')
{
Call ActionClass2();
}
.
.
.
.
.
}
}

Very simple!! You can write your application in one servlet + JSPs (JSPs get converted into servlets internally by Jasper engine.)

This is my crazy thinking. Please don’t do this, otherwise you might get fired .Feeling beat up

2 comments:

Anonymous said...

Hello. Facebook takes a [url=http://www.onlineslots.gd]free casino bonus[/url] wager side with on 888 casino freight: Facebook is expanding its efforts to the moment real-money gaming to millions of British users after announcing a train with the online gambling steadfast 888 Holdings.And Bye.

Anonymous said...

Hello. Facebook takes a [url=http://www.casinobonus.gd]casinos online[/url] risk on 888 casino traffic: Facebook is expanding its efforts to tip real-money gaming to millions of British users after announcing a act with the online gambling associates 888 Holdings.And Bye.