sudhakar_koundinya
asked on
How to share data between Java Server Faces and normal JSPs/Servlets
Hi All,
How to share the data between Java Server Faces and normal JSPs. the session/request handling procedures are different from normal JSP coding. And I am always getting null in accessing the data
If any body of you guys know the solution plz help me
Thanks
Sudhakar
How to share the data between Java Server Faces and normal JSPs. the session/request handling procedures are different from normal JSP coding. And I am always getting null in accessing the data
If any body of you guys know the solution plz help me
Thanks
Sudhakar
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Mogalmanic,
Do you think the model what you have given is pure JSF??
Do you think the model what you have given is pure JSF??
ASKER
Reason why I am asking is
This is valid but at the same time studio Creator is considering as invalid. And the page similar to this when I created in Studio Creator, and included a small for loop, it is raising exception.
Could you plz tell me the reason for this??
Regards
Sudhakar
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>…
<h:form>
<%
for(int i=0;i<100;i++)
{
%>
Email address:
<h:inputText value="#{registrationBean. email}"/>< BR> <!--Access the email property in the registration bean-->
Password:
<h:inputSecret value="#{registrationBean. password}" /><BR>
<h:commandButton value="Sign Me Up!" action="#{registrationBean .register} "/>
<%
}
%>
</h:form>
</f:view>
This is valid but at the same time studio Creator is considering as invalid. And the page similar to this when I created in Studio Creator, and included a small for loop, it is raising exception.
Could you plz tell me the reason for this??
Regards
Sudhakar
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>…
<h:form>
<%
for(int i=0;i<100;i++)
{
%>
Email address:
<h:inputText value="#{registrationBean.
Password:
<h:inputSecret value="#{registrationBean.
<h:commandButton value="Sign Me Up!" action="#{registrationBean
<%
}
%>
</h:form>
</f:view>
ASKER
This is what Studio Creator has created
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html;cha rset=UTF-8 " pageEncoding="UTF-8"/>
<f:view>
<html lang="en-US" xml:lang="en-US">
<head>
<meta content="no-cache" http-equiv="Cache-Control" />
<meta content="no-cache" http-equiv="Pragma"/>
<title>general$login Title</title>
<link href="resources/stylesheet .css" rel="stylesheet" type="text/css"/>
</head>
<body style="-rave-layout: grid">
<h:form binding="#{general$login.f orm1}" id="form1">
<h:outputText binding="#{general$login.o utputText1 }" id="outputText1" style="left: 72px; top: 96px; position: absolute" value="Login"/>
<h:outputText binding="#{general$login.o utputText3 }" id="outputText3" style="left: 72px; top: 144px; position: absolute" value="Password"/>
<h:inputText binding="#{general$login.t xtLogin}" id="txtLogin" style="left: 168px; top: 96px; position: absolute"/>
<h:inputSecret binding="#{general$login.t xtPasscode }" id="txtPasscode" style="left: 168px; top: 144px; position: absolute"/>
<h:commandButton action="#{general$login.bt nLogin_act ion}" binding="#{general$login.b tnLogin}" id="btnLogin"
style="left: 192px; top: 192px; position: absolute" value="Login"/>
<h:commandLink action="#{general$login.ln kNewRegist er_action} " binding="#{general$login.l nkNewRegis ter}" id="lnkNewRegister" style="left: 384px; top: 96px; position: absolute">
<h:outputText binding="#{general$login.n ewRegister Text}" id="newRegisterText" value="Not yet Register?"/>
</h:commandLink>
<h:commandLink action="#{general$login.ln kForgotPas sword_acti on}" binding="#{general$login.l nkForgotPa ssword}" id="lnkForgotPassword" style="left: 384px; top: 120px; position: absolute">
<h:outputText binding="#{general$login.f orgotPassw ordText}" id="forgotPasswordText" value="Link Action"/>
</h:commandLink>
</h:form>
</body>
</html>
</f:view>
</jsp:root>
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html;cha
<f:view>
<html lang="en-US" xml:lang="en-US">
<head>
<meta content="no-cache" http-equiv="Cache-Control"
<meta content="no-cache" http-equiv="Pragma"/>
<title>general$login Title</title>
<link href="resources/stylesheet
</head>
<body style="-rave-layout: grid">
<h:form binding="#{general$login.f
<h:outputText binding="#{general$login.o
<h:outputText binding="#{general$login.o
<h:inputText binding="#{general$login.t
<h:inputSecret binding="#{general$login.t
<h:commandButton action="#{general$login.bt
style="left: 192px; top: 192px; position: absolute" value="Login"/>
<h:commandLink action="#{general$login.ln
<h:outputText binding="#{general$login.n
</h:commandLink>
<h:commandLink action="#{general$login.ln
<h:outputText binding="#{general$login.f
</h:commandLink>
</h:form>
</body>
</html>
</f:view>
</jsp:root>
what is the exception?
ASKER
Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
Exception Details: org.apache.jasper.JasperEx
/general/test.jsp(14,18) The content of elements must consist of well-formed character data or markup.
Possible Source of Error:
Class Name: org.apache.jasper.compiler
File Name: DefaultErrorHandler.java
Method Name: jspError
Line Number: 43
I just used this simple code
<%
for(int i=0;i<100;i++)
%>
<h:selectBooleanCheckbox binding="#{general$test.ch
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
https://www.experts-exchange.com/questions/21426657/For-loops-while-loops-and-conditional-statements-in-JSF.html
Thanks
Sudhakar