0

I am using display:table with display:column along with bean:write to print out some values from my request.

<bean:write name="DisplayBookForm" property="bookType" />

I have an import like

<%@page import="org.model.MyConstants"%>

In there I have a simple function

public static String getBookTypeName(int id){
     //lots of if's based on id 
     String bookTypeName = "Fantasy";
     return bookTypeName;
}

Is there anyway I could pass in my DisplayBookForm bookType property value into this function and then display its String return? Something like:

<c:out value="<%=MyConstants.getBookTypeName(${DisplayBookForm.bookType}) %>" />
<%=MyConstants.getBookTypeName(${DisplayBookForm.bookType})%>

Which seem to not work, perhaps set the bean using c:set and then use it in the <% tags?

user3013612
  • 61
  • 1
  • 4

0 Answers0