Check if portlet object exist in JSP
up vote
0
down vote
favorite
File a.jsp has code:
<%
Object OBJECT = smt...
%>
<jsp:include page="c.jsp"/>
File c.jsp has code:
<%
do smth with OBJECT
%>
File b.jsp has code:
<jsp:include page="c.jsp"/>
Problem is that b.jsp does not have code for creating/initialize a OBJECT and when workflow is such that b.jsp is supposed to be rendered there is a "OBJECT
cannot be resolved to a variable" error.
How to check if OBJECT exists in c.jsp page context?
java jsp liferay portlet
add a comment |
up vote
0
down vote
favorite
File a.jsp has code:
<%
Object OBJECT = smt...
%>
<jsp:include page="c.jsp"/>
File c.jsp has code:
<%
do smth with OBJECT
%>
File b.jsp has code:
<jsp:include page="c.jsp"/>
Problem is that b.jsp does not have code for creating/initialize a OBJECT and when workflow is such that b.jsp is supposed to be rendered there is a "OBJECT
cannot be resolved to a variable" error.
How to check if OBJECT exists in c.jsp page context?
java jsp liferay portlet
Check the answer, and let us know whether your problem is solved or not!
– Avijit Barua
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
File a.jsp has code:
<%
Object OBJECT = smt...
%>
<jsp:include page="c.jsp"/>
File c.jsp has code:
<%
do smth with OBJECT
%>
File b.jsp has code:
<jsp:include page="c.jsp"/>
Problem is that b.jsp does not have code for creating/initialize a OBJECT and when workflow is such that b.jsp is supposed to be rendered there is a "OBJECT
cannot be resolved to a variable" error.
How to check if OBJECT exists in c.jsp page context?
java jsp liferay portlet
File a.jsp has code:
<%
Object OBJECT = smt...
%>
<jsp:include page="c.jsp"/>
File c.jsp has code:
<%
do smth with OBJECT
%>
File b.jsp has code:
<jsp:include page="c.jsp"/>
Problem is that b.jsp does not have code for creating/initialize a OBJECT and when workflow is such that b.jsp is supposed to be rendered there is a "OBJECT
cannot be resolved to a variable" error.
How to check if OBJECT exists in c.jsp page context?
java jsp liferay portlet
java jsp liferay portlet
asked 2 days ago
user435421
185416
185416
Check the answer, and let us know whether your problem is solved or not!
– Avijit Barua
yesterday
add a comment |
Check the answer, and let us know whether your problem is solved or not!
– Avijit Barua
yesterday
Check the answer, and let us know whether your problem is solved or not!
– Avijit Barua
yesterday
Check the answer, and let us know whether your problem is solved or not!
– Avijit Barua
yesterday
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
You can use if condition in jsp like...
<c:if test = "${object == null}">
what you want to do...
</c:if>
To use this syntax you need to add this line at the top of jsp page!
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
And need to add JSTL
jar at lib folder. You can get it from here
add a comment |
up vote
0
down vote
You can use <c:if />
taglib in Liferay. At the top section of your jsp file insert this line:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Then you can use the taglib as follows:
<c:if test="<%= object != null %>">
<!-- HTML elements -->
<%
//scriptlet
%>
</c:if>
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can use if condition in jsp like...
<c:if test = "${object == null}">
what you want to do...
</c:if>
To use this syntax you need to add this line at the top of jsp page!
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
And need to add JSTL
jar at lib folder. You can get it from here
add a comment |
up vote
0
down vote
You can use if condition in jsp like...
<c:if test = "${object == null}">
what you want to do...
</c:if>
To use this syntax you need to add this line at the top of jsp page!
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
And need to add JSTL
jar at lib folder. You can get it from here
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use if condition in jsp like...
<c:if test = "${object == null}">
what you want to do...
</c:if>
To use this syntax you need to add this line at the top of jsp page!
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
And need to add JSTL
jar at lib folder. You can get it from here
You can use if condition in jsp like...
<c:if test = "${object == null}">
what you want to do...
</c:if>
To use this syntax you need to add this line at the top of jsp page!
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
And need to add JSTL
jar at lib folder. You can get it from here
answered 2 days ago
Avijit Barua
9161215
9161215
add a comment |
add a comment |
up vote
0
down vote
You can use <c:if />
taglib in Liferay. At the top section of your jsp file insert this line:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Then you can use the taglib as follows:
<c:if test="<%= object != null %>">
<!-- HTML elements -->
<%
//scriptlet
%>
</c:if>
add a comment |
up vote
0
down vote
You can use <c:if />
taglib in Liferay. At the top section of your jsp file insert this line:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Then you can use the taglib as follows:
<c:if test="<%= object != null %>">
<!-- HTML elements -->
<%
//scriptlet
%>
</c:if>
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use <c:if />
taglib in Liferay. At the top section of your jsp file insert this line:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Then you can use the taglib as follows:
<c:if test="<%= object != null %>">
<!-- HTML elements -->
<%
//scriptlet
%>
</c:if>
You can use <c:if />
taglib in Liferay. At the top section of your jsp file insert this line:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Then you can use the taglib as follows:
<c:if test="<%= object != null %>">
<!-- HTML elements -->
<%
//scriptlet
%>
</c:if>
edited 2 days ago
answered 2 days ago
Abdollah
4011
4011
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238472%2fcheck-if-portlet-object-exist-in-jsp%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Check the answer, and let us know whether your problem is solved or not!
– Avijit Barua
yesterday