I have a datepicker. What I want to achieve is: based on the date selected by user, the data for that day should be displayed on the jsp. I have used a serveResource function for displaying some data in some other form. Should I create another such function such that based on selected date, data is displayed for that particular data?
相关问题
- #{facesContext} EL expression not resolved at runt
- jsp caching tag library
- JSP template implementation (Composite View Patter
- how to add a list of string into json object in js
- Two dimensional arraylist with c:foreach jstl tag
相关文章
- jsp里面的画布功能,为什么会出错?求大佬找下问题
- JSP String formatting Truncate
- Forward request from servlet to jsp
- Comparing string and boolean in Expression languag
- Passing a Java object value in Custom JSP tag
- Passing a enum value as a tag attribute in JSP
- Application Error: AccessControlException
- MySQL driver problem in my dynamic web project (JP
You can pass parameter under resourceURL and check that parameter under serveResorce method. Based on that parameter call your function or code
i.e
You are using
serveResource
so you want to fetch data using ajax.Unfortunately you can't have
resourceURL
behave the same asactionURL
in otherwords you can't have multiple methods for servingresourceRequest
like you have to serveactionRequest
.actionURL
to call different methods but would refresh the page which you don't want as I seeresourceURL
to let theserveResource
method know what you want to return and then in theserveResource
method of the portlet haveswitch-case
orif-else
to determine from where has this request come.Going with the second approach:
You jsp would look something like this (might not work as it is):
Your
serveResource
method would be something like this (I am assuming your portlet extendsMVCPortlet
class of liferay):Note:
As a side-note you can try Spring MVC portlet which gives you the ability to have different methods for serving
resourceRequest
.