• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to shrink jsp page

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



thanks
mohan
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic