• Post Reply Bookmark Topic Watch Topic
  • New Topic

call java funtion in jstl

 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I have some thing like below.


Can anyone please help me..how would call the java function in jstl?

thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't.

What does the function do? Chance are it's something that should have been taken care of in the controller.
 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

The function calls the pagecontrol. reset method.

How would I call the function in the controler?

Can you give me some example?


thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not with the scant information that you've posted. You'll need to explain in more detail.
 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm doing pagination using jstl.

I have a function paging.reset(1,recordpagein, pagelinks, result.size()); //(1, pagesize, pagelinks, arraylist size)

I am calling this function from jsp page uisng jstl. like below. How would I pass the arraylist size suing jstl or scriplet?


boolean flag = false;

<c:if test="${fn:length(result) >0}" >
<%
flag = true;

//call java function

paging.reset(1,recordpagein, pagelinks, result.size()) ; //here I'm gettng error, how would I pass the size of the list


%</c:if>










 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But what does the reset() method do? You should probably be calling paging.reset() in the JSP's accompanying servlet or controller. It's bad practice to use scriptlets in JSPs.

The answer to your question is that "result" is stored as an attribute, so you must pull it from the PageContext.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!