sanket_joshi100
05-22-2008, 07:53 AM
Hi,
I have a jsp file as below. In which a javascript(including jstl) is written.. but when execution comes to this jsp file, the javascript is not getting executed. i am getting the System.out.println output on consol
i.e. System.out.print("dosave: " + request.getAttribute("saveSuccessful"));
, but only javascript is not getting executed. Also i cant see alert written in script.
Can anone tell me why its happening? Plz help asap.
<%@ page contentType="text/html" session="false" autoFlush="true" isErrorPage="false" %>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%System.out.print("dosave: " + request.getAttribute("saveSuccessful")); %>
<script language="JavaScript">
<%
System.out.print("Inside Javascript");
%>
alert("Inside saveRedirect");
alert('<%=request.getAttribute("saveSuccessful")%>');
<c:choose>
<c:when test="${saveSuccessful==true}">
location.href = "<portletAPI:createReturnURI />";
</c:when>
<c: otherwise>
location.href = "<portletAPI:createURI><portletAPI:URIAction name="cmd_edit"/></portletAPI:createURI>";
</c: otherwise>
</c:choose>
</script>
I have a jsp file as below. In which a javascript(including jstl) is written.. but when execution comes to this jsp file, the javascript is not getting executed. i am getting the System.out.println output on consol
i.e. System.out.print("dosave: " + request.getAttribute("saveSuccessful"));
, but only javascript is not getting executed. Also i cant see alert written in script.
Can anone tell me why its happening? Plz help asap.
<%@ page contentType="text/html" session="false" autoFlush="true" isErrorPage="false" %>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%System.out.print("dosave: " + request.getAttribute("saveSuccessful")); %>
<script language="JavaScript">
<%
System.out.print("Inside Javascript");
%>
alert("Inside saveRedirect");
alert('<%=request.getAttribute("saveSuccessful")%>');
<c:choose>
<c:when test="${saveSuccessful==true}">
location.href = "<portletAPI:createReturnURI />";
</c:when>
<c: otherwise>
location.href = "<portletAPI:createURI><portletAPI:URIAction name="cmd_edit"/></portletAPI:createURI>";
</c: otherwise>
</c:choose>
</script>