• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to shrink jsp page

 
mohan cheepu
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

1)
one page have includeed so many jsp pages. Now If i added extra code,it is nt compiling . some method written in some jsp pages , so i think that move to those method in to java class ,so in that way i can shrink jsp page . is it correct ?

2)

In jsp page ,

String getMeth()
{

A obj=new A();

return obj.meth();

}

whole method move to java class , calling that method in jsp . why i wrote it ,becoz getMeth() ,this is used in many include jsp page , excatly no idea how many jsp they used.

which is best way to shrink jsp ,keep whole method jsp or follow above method .

please let me know

thanks
mohan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ANy JSP written after 2002 should have no Java code in them. None. Refactor your JSP such that all Java processing happens in controllers and beans.

Perhaps this article may be helpful.
 
mohan cheepu
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

you are saying correct. But my application pure developed by jsp and java.



thanks
mohan
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your situation sounds perfect for an EL function. Move your method into its own class and make the method static. This allows you to create an EL function, so that you can call the method from your JSP without using scriptlets. See DefineELFunctions for more information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!