Using Bean to forward page.

Hey I just was wondering if there is a way to directly forward a page from the bean using "Facescontext" or something from the bean to another page? I need this for session timing out. So I have code that runs a function as soon as the session expires but i want the page to move to the login page.. any suggestions?

For that purpose, you need to use Filter,
public class LogoutFilter implements Filter
    //the login page uri
    private static final String SIGNOUT_PAGE_URI = "logOut.jsf";
    public void init( FilterConfig filterConfig ) throws ServletException
    public void doFilter( ServletRequest req, ServletResponse res, FilterChain chain ) throws IOException, ServletException
        HttpServletRequest request = (HttpServletRequest )req;
        String url = request.getServletPath();
        String query = request.getQueryString();
        if( !authorize(request) && !isRedirected(request))
            request.getRequestDispatcher( SIGNOUT_PAGE_URI ).forward( req, res );
        else
            chain.doFilter( req, res );
    public void destroy()
    private boolean authorize( HttpServletRequest req )
        Object obj = req.getSession().getAttribute( UserBean.KEY_CURRENT_USER );
        return obj != null;
    private boolean isRedirected( HttpServletRequest req )
         boolean isRedirected = false;
        Object obj = req.getParameter(AppConstants.SecurityConstants.IS_REDIRECTED);
        boolean isObjectNull = (obj == null);
        if(!isObjectNull){
             String objectValue = (String)obj;
             isRedirected = objectValue.equals(Boolean.TRUE.toString());
        return  (isRedirected);
Register this filter in web.xml:
<filter>
  <filter-name>logoutFilter</filter-name>
  <filter-class>someOrg.filter.LogoutFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>logoutFilter</filter-name>
  <url-pattern>/faces/*</url-pattern>
</filter-mapping>

Similar Messages

  • Cannot save beans in a session OR use the same beans in multiple pages

    Hi all I use these code to my jsp file to create a session and store a bean.
    Unfortunately, the session cannot store the beans so that I can use them in the next page.What did I omit? Regardless the session scope, can I use request scope beans and with jsp:forward use them in multiple page? (I have tried it but it doesn't work).
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page session="true"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%
    String nextPage = request.getParameter("np");
    if(nextPage.equalsIgnoreCase("checkDate")){
    %>
      <jsp:useBean id="checkDate" scope="request" class="essex.kkarad.beans.checkDateBean" />
      <jsp:setProperty name="checkDate" property="*"/>
    <%
        checkDate.validate();
    %>
    <jsp:forward page="Availability.jsp"></jsp:forward>
    <%
    } else if(nextPage.equalsIgnoreCase("checkRooms")) {
    %>
    <jsp:useBean id="checkRooms" scope="request" class="essex.kkarad.beans.checkRoomsBean" />
    <jsp:setProperty name="checkRooms" property="*"/>
    <%
       if(!checkRooms.validate()){
    %>
    <jsp:forward page="Availability.jsp"></jsp:forward>
    <%
    %>
    <%
    %>

    You should also be encoding the URL so that you don't have to worry about loosing the session if the user has cookies turned off:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page session="true"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%
      String nextPage = request.getParameter("np");
      String availabilityPage = response.encodeURL("Availability.jsp");
      if(nextPage.equalsIgnoreCase("checkDate")){
    %>
      <jsp:useBean id="checkDate" scope="session" class="essex.kkarad.beans.checkDateBean" />
      <jsp:setProperty name="checkDate" property="*"/>
    <%
        checkDate.validate();
    %>
    <jsp:forward page="<%=availabilityPage%>"></jsp:forward>
    <%
      } else if(nextPage.equalsIgnoreCase("checkRooms")) {
    %>
    <jsp:useBean id="checkRooms" scope="session" class="essex.kkarad.beans.checkRoomsBean" />
    <jsp:setProperty name="checkRooms" property="*"/>
    <%
       if(!checkRooms.validate()){
    %>
    <jsp:forward page="<%=availabilityPage%>"></jsp:forward>
    <%
    %>
    <%
    %>

  • Calling managed bean method using ajax on jsp page loading

    Hello,
    I am using jsf1.1 i want to call managed bean method when page gets loaded using ajax.
    Thanks
    K.Ramu

    Use an ajaxical JSF framework, for example Ajax4jsf (part of RichFaces).
    But why don´t you just use the constructor of the bean class to do some stuff prior to page loading?

  • Use commandLink to forward non-jsf page cause other commandLink invalidate

    Hi :
    I use commandLink to forward to non jsf page , after click the link , it worked , success to 1.jsp. Then I click another link , the other commandLink doesn't work.
    any one have the same problem ?
    JSF page:
    <h:commandLink action="#{MenuHandler.go}">
         <h:outputText value="process" />
         <f:param value="1.jsp" name="forward" />
    </h:commandLink>
    MenuHandler.java
      public static String go() {
                HttpServletRequest req = getRequest();
                String forward = req.getParameter("forward");
                getExternalContext().redirect(forward);
                FacesContext.getCurrentInstance().responseComplete();
                return "success";
      }ps:there is one <h:form/> in my jsf page and I use:
    jdk1.5.0
    jsf-1_1
    Tomcat-5.0.28

    to supplement:
    I found something strange:
    The JSF page I used is for menu purpose.
    So there is a <BASE target="mainFrame"> tag in my JSF page.
    If I mark it . Then other commandLink can work ~~
    Because the page is a menu page , so I can't mark the <BASE target="mainFrame">

  • Bean value forward to servlet

    Hi all,
    i have bean package cedars;
    import java.util.Hashtable;
    import java.util.*;
    public class FormBean {
          private String name = null;
          private String stuNumber = null;
          private String facultyName= null;
          private String quesOne = null;
          private String quesTwo = null;
          private String quesThree = null;
          private String quesFour= null;
          private String quesFive= null;
          private String quesSix= null;
          private String quesSeven= null;
          private String quesEight= null;
          private String quesNine= null;
          private String quesTen= null;
          private String quesEleven= null;
          private String quesTwelve= null;
          private String quesThirteen= null;
          private String quesFourteen= null;
          private String quesFifteen= null;
          private String quesSixteen= null;
          private String quesSeventeen = null;     
          private String quesEighteen=null;
          private String quesNineteen=null;
          private String quesTwenty=null;
          private String quesTwentyOne=null;
          private Hashtable errors = new Hashtable();
          public boolean validate() {
                  boolean allOk=true;
                  if (stuNumber.equals("")|| stuNumber.length() !=10) {
                      errors.put("stuNumber","Please enter a valid student Number");
                      stuNumber="";
                      allOk=false;
                    } else {
                        try {
                            int x = Integer.parseInt(stuNumber);
                          } catch (NumberFormatException e) {
                            errors.put("stuNumber","Please enter a valid student Number");
                            stuNumber="";
                            allOk=false;
                    }//else
                  return allOk;        
          public String getErrorMsg(String s) {
                  String errorMsg =(String)errors.get(s.trim());
                  return (errorMsg == null) ? "":errorMsg;
         public FormBean () {
              again(); 
         /* Name */
           public String getName() {
             return (this.name);
           public void setName(String name) {
             this.name = name;
           /* Student number */
           public String getStuNumber(){
             return (this.stuNumber);
           public void setStuNumber(String stuNumber){
             this.stuNumber = stuNumber;
           /* gender */
           private String gender= null;
           public String getGender(){
             return (this.gender);
           public void setGender(String gender) {
             this.gender = gender;
           /*college*/
           public String getFacultyName(){
             return (this. facultyName);
           public void setFacultyName(String  facultyName){
             this. facultyName=facultyName;
           /*degree*/
           String degree=null;
           public String getDegree() {
                  return (this.degree);
           public void setDegree(String degree){
             this.degree =degree;
           /* year */
           private String year = null;
           public String getYear() {
             return (this.year);
           public void setYear(String year){
             this.year = year;
           /*question one */
           public String getQuesOne() {
             return (this.quesOne);
           public void setQuesOne(String quesOne){
             this.quesOne = quesOne;
           /*question two */
           public String getQuesTwo() {
             return (this.quesTwo);
           public void setQuesTwo(String quesTwo){
             this.quesTwo = quesTwo;
           /*question Three */
           public void setQuesThree(String quesThree){
             this.quesThree = quesThree;
           /*question four */
           public String getQuesFour() {
             return (this.quesFour);
           public void setQuesFour(String quesFour){
             this.quesFour = quesFour;
           /*question five */
           public String getQuesFive() {
             return (this.quesFive);
           public void setQuesFive(String quesFive){
             this.quesFive = quesFive;
           /*question six */
           public String getQuesSix() {
             return (this.quesSix);
           public void setQuesSix(String quesSix){
             this.quesSix =quesSix;
           /*question seven */
           public String getQuesSeven(){
             return (this.quesSeven);
           public void setQuesSeven(String quesSeven){
             this.quesSeven =quesSeven;
           /*question Eight */
           public String getQuesEight() {
             return (this.quesEight);
           public void setQuesEight(String quesEight){
             this.quesEight =quesEight;
           /*question Nine */
           public String getQuesNine() {
             return (this.quesNine);
           public void setQuesNine(String quesNine) {
             this.quesNine =quesNine;
           /*question Ten */
           public String getQuesTen(){
             return (this.quesTen);
           public void setQuesTen(String quesTen){
             this.quesNine =quesTen;
           /*question Eleven*/
           public String getQuesEleven(){
             return (this.quesEleven);
           public void setQuesEleven(String quesEleven) {
             this.quesEleven =quesEleven;
           /* question Twelve*/
           public String getQuesTwelve(){
             return (this.quesTwelve);
           public void setQuesTwelve(String quesTwelve) {
             this.quesTwelve =quesTwelve;
           /* question Thirteen**/
           public String getQuesThirteen() {
             return (this.quesThirteen);
           public void setQuesThirteen(String quesThirteen) {
             this.quesThirteen =quesThirteen;
           /*question Fourteen*/
           public String getQuesFourteen() {
             return (this.quesFourteen);
           public void setQuesFourteen(String quesFourteen) {
             this.quesFourteen =quesFourteen;
           /* question Fifteen*/
           public String getQuesFifteen(){
             return (this.quesFifteen);
           public void setQuesFifteen(String quesFifteen) {
             this.quesFifteen =quesFifteen;
          /* question Sisteen*/
           public String getQuesSixteen(){
             return (this.quesSixteen);
           public void setQuesSixteen(String quesSixteen) {
             this.quesSixteen =quesSixteen;
          /* question Seventeen */
           public String getQuesSeventeen (){
             return (this.quesSeventeen );
           public void setQuesSeventeen (String quesSeventeen ) {
             this.quesSeventeen=quesSeventeen ;
           /* question Eighteen*/
           public String getQuesThree(){
             return (this.quesThree);
         public String getQuesEighteen (){
                  return (this.quesEighteen );
         public void setQuesEighteen(String quesEighteen ){
                  this.quesEighteen =quesEighteen ;
           /*question Nineteen*/
         public String getQuesNineteen(){
             return (this.quesNineteen );
          public void setQuesNineteen(String quesNineteen ){
               this.quesNineteen =quesNineteen ;
         /*Twenty*/
      public String getQuesTwenty(){
         return (this.quesTwenty );
      public void setQuesTwenty(String quesTwenty ){
         this.quesTwenty =quesTwenty ;
         /*Twenty-One*/
    public String getQuesTwentyOne(){
    return (this.quesTwentyOne );
    public void setQuesTwentyOne(String quesTwentyOne ) {
          this.quesTwentyOne =quesTwentyOne ;     }
    public void setErrors(String key, String msg) {
             errors.put(key,msg);
           public void again(){                               
                  setName("");
                  setStuNumber("");
                  setGender("");
                  setFacultyName("");
                  setDegree("");            
                  setYear("");           
                  setQuesOne("");
                  setQuesTwo("");
                  setQuesThree("");
                  setQuesFour("");
                  setQuesFive("");
                  setQuesSix("");
                  setQuesSeven("");
                  setQuesEight("");
                  setQuesNine("");
                  setQuesTen("");
                  setQuesEleven("");
                  setQuesTwelve("");
                  setQuesThirteen("");
                  setQuesFourteen("");
                  setQuesFifteen("");     
                  setQuesSixteen("");
                  setQuesSeventeen("");
                  setQuesEighteen("");
                  setQuesNineteen("");
                  setQuesTwenty("");
                  setQuesTwentyOne("");
    }and process.jsp
    %@ page import="java.util.*" %>
    <html>
      <head>
    <jsp:useBean id="formHandler" class="cedars.FormBean" scope="request">
    <jsp:setProperty name="formHandler" property="*"/>
    </jsp:useBean>
    <%
       if (formHandler.validate()) {%>
    <jsp:forward page="/servlet/Insert"/>
    <% } else { %>
    <jsp:forward page="/resubmit.jsp"/>
    <% } %>
    </body>
    </html>row now the forward to resubmit.jsp is work , but forward to <jsp:forward page="/servlet/Insert"/>
    is not work , why?
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import javax.sql.*;
    import pool.ConnectionPool;
    public class Insert extends HttpServlet {   
        Connection conn = null;
        Statement stmt = null;
         ResultSet rs = null;
         PreparedStatement ps = null;
         ConnectionPool connectionPool = null;
       * We want to initialized the JDBC connections here
        public void init()
                 String jdbcDriver = "com.mysql.jdbc.Driver";
                 String dbURL ="jdbc:mysql://localhost/survey?";
                 try
                 //instantiate the connection pool object by passing the
                 //jdbc driver, database URL, username, and password
                 connectionPool = new ConnectionPool(jdbcDriver, dbURL,
                 "root","mysql");
                 //specify the initial number of connections to establish
                 connectionPool.setInitialConnections(5);
                 //specify number of incremental connections to create if
                 //pool is exhausted of available connections
                 connectionPool.setIncrementalConnections(5);
                 //specify absolute maximum number of connections to create
                 connectionPool.setMaxConnections(20);
                 connectionPool.createPool(); //create the connection pool
                 catch(Exception e)
                 System.out.println("Error: " + e);
    /** Destroys the servlet.
        public void destroy() {
        public void doGet(
        HttpServletRequest request,
        HttpServletResponse response)
        throws IOException, ServletException {  
           }// end of DoGet
    public void doPost(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {    
         res.setContentType("text/html");
         PrintWriter out = res.getWriter(); 
       try {        
        //Get the incoming data parameters from the client         
               String  name=req.getParameter("name");
               String  stuNumber=req.getParameter("stuNumber");
               String  gender=req.getParameter("gender");
               String  facultName=req.getParameter("facultyName");
               String  degree=req.getParameter("degree");          
               String  year=req.getParameter("year");        
               String  quesOne=req.getParameter("quesOne");
               String  quesTwo=req.getParameter("quesTwo");
               String  quesThree=req.getParameter("quesThree");
               String  quesFour=req.getParameter("quesFour");
               String  quesFive=req.getParameter("quesFive");
               String  quesSix=req.getParameter("quesSix");
               String  quesSeven=req.getParameter("quesSeven");
               String  quesEight=req.getParameter("quesEight");
               String  quesNine=req.getParameter("quesNine");
               String  quesTen=req.getParameter("quesTen");
               String  quesEleven=req.getParameter("quesEleven");
               String  quesTwelve=req.getParameter("quesTwelve");
               String  quesThirteen=req.getParameter("quesThirteen");
               String  quesFourteen=req.getParameter("quesFourteen");
               String  quesFifteen=req.getParameter("quesFifteen");
               String  quesSixteen=req.getParameter("quesSixteen");
               String  quesSeventeen=req.getParameter("quesSeventeen");
               String  quesEighteen=req.getParameter("quesNineteen");
               String  quesNineteen=req.getParameter("quesNineteen");
               String  quesTwenty=req.getParameter("quesTwenty");
               String  quesTwentyOne=req.getParameter("quesTwentyOne");
               String ErrMsg="";
               String found="";
               HttpSession userSession = req.getSession(true);   
               HttpSession session=req.getSession();
               for (int i=0; i<stuNumber.length(); i++){              
                    char ch=stuNumber.charAt(i);
                   if (Character.isLetter(ch)){
                     found =found +ch;}
                * check the empty fields
                       if (stuNumber.equals("") ||                    
                                ((found.length()>=1 ))||                         
                                (stuNumber.length()!=10))
                           out.println("<html>");                        
                           out.println("<body bgcolor=\"#FFFFFF\">");
                            out.println("<center>");
                           out.println("<strong> Valid Studend number is require!<strong>");
                           out.println("</center>");
                           out.println("</body>");                        
                           out.println("</html>");
                           out.close();
                       Integer q1=0, q2=0, q3=0, q4=0, q5=0, q6=0, q7=0, q8=0,q9=0,q10=0;
                       Integer q11=0, q12=0, q13=0, q14=0, q15=0, q16=0, q17=0, q18=0, q19=0, q20=0,q21=0;
                         q1 = Integer.valueOf(quesOne);
                         q2 = Integer.valueOf(quesTwo);
                         q3 = Integer.valueOf(quesThree);
                         q4 = Integer.valueOf(quesFour);
                         q5 = Integer.valueOf(quesFive);
                         q6 = Integer.valueOf(quesSix);
                         q7 = Integer.valueOf(quesSeven);
                         q8 = Integer.valueOf(quesEight);
                         q9 = Integer.valueOf(quesNine);
                          q10 = Integer.valueOf(quesTen);
                          q11 = Integer.valueOf(quesEleven);
                          q12 = Integer.valueOf(quesTwelve);
                          q13 = Integer.valueOf(quesThirteen);
                          q14 = Integer.valueOf(quesFourteen);
                           q15 = Integer.valueOf(quesFifteen);
                           q16 = Integer.valueOf(quesSixteen);
                            q17 = Integer.valueOf(quesSeventeen);
                             q18 = Integer.valueOf(quesEighteen);
                             q19 = Integer.valueOf(quesNineteen);
                             q20 = Integer.valueOf(quesTwenty);
                              q21 = Integer.valueOf(quesTwentyOne);
                       Integer total=0;
                       total=q1+q2+q3+q4+q5+q6+q7+q8+q9+q10+q11+q12+q13+q14+q15+q16+q17+q18+q19+q20+q21;
                       /*if form is valid, catch the session*/
                         userSession.setAttribute("stuNumber",stuNumber );
                           userSession.setAttribute("quesOne",quesOne); 
                           userSession.setAttribute("quesTwo",quesTwo); 
                           userSession.setAttribute("quesThree",quesThree); 
                           userSession.setAttribute("quesFour",quesFour); 
                           userSession.setAttribute("quesFive",quesFive); 
                           userSession.setAttribute("quesSix", quesSix); 
                           userSession.setAttribute("quesSeven",quesSeven); 
                           userSession.setAttribute("quesEight",quesEight); 
                           userSession.setAttribute("quesNine",quesNine); 
                           userSession.setAttribute("quesTen",quesTen); 
                           userSession.setAttribute("quesTwelve", quesTwelve);
                           userSession.setAttribute("quesEleven",  quesEleven);
                           userSession.setAttribute("quesThirteen", quesThirteen);
                           userSession.setAttribute("quesFourteen", quesFourteen);
                           userSession.setAttribute("quesFifteen",   quesFifteen);              
                          userSession.setAttribute("quesSixteen",  quesSixteen);             
                          userSession.setAttribute("quesSeventeen",quesSeventeen);
                          userSession.setAttribute("quesEighteen", quesEighteen);
                          userSession.setAttribute("quesNineteen",quesNineteen);
                          userSession.setAttribute("quesTwenty",quesTwenty);
                           userSession.setAttribute("quesTwentyOne",quesTwentyOne);
                           userSession.setAttribute("total",total);
                            RequestDispatcher disp;
                            disp = getServletContext().getRequestDispatcher("/confirmation.jsp");
                            disp.forward(req, res);      
                          //get free connection from pool
                            conn =connectionPool.getConnection();      
                //select a database
               // conn.setCatalog("survey");
                /* add this part*/
                stmt = conn.createStatement();
                rs = stmt.executeQuery("SELECT*  FROM survey where stuNumber='"+stuNumber+"'");
                    int count =0;//how many rows we can find.
                    while (rs.next()){
                        count++;
                    connectionPool.returnConnection(conn);
                 if(count<1){                       
                          conn.setAutoCommit(false);
                        String  sql="insert into survey(name, stuNumber, gender,facultyName,degree, year, quesOne, quesTwo, quesThree, quesFour, quesFive, quesSix,quesSeven, quesEight, quesNine,quesTen,quesEleven, quesTwelve, quesThirteen, quesFourteen,quesFifteen, quesSixteen, quesSeventeen, quesEighteen, quesNineteen, quesTwenty, quesTwentyOne)";
                                             sql+="value(?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
                              ps = conn.prepareStatement(sql);
                              stmt = conn.createStatement();
                               ps.setString(1, name);
                              ps.setString(2, stuNumber);
                              ps.setString(3, gender);
                              ps.setString(4, facultName);
                              ps.setString(5, degree);
                              ps.setString(6, year);
                              ps.setString(7, quesOne);
                              ps.setString(8, quesTwo);
                              ps.setString(9, quesThree);
                              ps.setString(10, quesFour);
                              ps.setString(11, quesFive);
                              ps.setString(12, quesSix);
                              ps.setString(13, quesSeven);
                              ps.setString(14, quesEight);
                              ps.setString(15, quesNine);
                              ps.setString(16, quesTen);
                              ps.setString(17, quesEleven);
                              ps.setString(18, quesTwelve);
                              ps.setString(19, quesThirteen);
                              ps.setString(20, quesFourteen);
                              ps.setString(21, quesFifteen);
                              ps.setString(22, quesSixteen);
                              ps.setString(23, quesSeventeen);
                              ps.setString(24, quesEighteen);
                              ps.setString(25, quesNineteen);
                              ps.setString(26, quesTwenty);
                              ps.setString(27, quesTwentyOne);
                              ps.executeUpdate();                   
                         conn.commit();
                      conn.setAutoCommit(true);   
                      connectionPool.returnConnection(conn);
                 /* doing the update*/
                 else{
                      conn.setAutoCommit(false);
                      String sql2 = "UPDATE survey set name=?";
                        sql2+= ", gender=?,facultyName=?,degree=?, year=?, quesOne=?, questwo=?, quesThree=?, quesFour=?, quesFive=?, quesSix=?,";
                        sql2+= "quesSeven=?,quesEight=?, quesNine=?, quesTen=?,quesEleven=?, quesTwelve=?, quesThirteen=?, quesFourteen=?";
                        sql2+=",quesFifteen=?, quesSixteen=?, quesSeventeen=?, quesEighteen=?, quesNineteen=?, quesTwenty=?, quesTwentyOne=?";
                        sql2+="WHERE stuNumber=?";
                        ps = conn.prepareStatement(sql2);
                        stmt = conn.createStatement();
                         ps.setString(1, name);                    
                          ps.setString(2, gender);
                          ps.setString(3, facultName);
                          ps.setString(4, degree);
                          ps.setString(5, year);
                          ps.setString(6, quesOne);
                          ps.setString(7, quesTwo);
                          ps.setString(8, quesThree);
                          ps.setString(9, quesFour);
                          ps.setString(10, quesFive);
                          ps.setString(11, quesSix);
                          ps.setString(12, quesSeven);
                          ps.setString(13, quesEight);
                          ps.setString(14, quesNine);
                          ps.setString(15, quesTen);
                          ps.setString(16, quesEleven);
                          ps.setString(17, quesTwelve);
                          ps.setString(18, quesThirteen);
                          ps.setString(19, quesFourteen);
                          ps.setString(20, quesFifteen);
                          ps.setString(21, quesSixteen);
                          ps.setString(22, quesSeventeen);
                          ps.setString(23, quesEighteen);
                          ps.setString(24, quesNineteen);
                          ps.setString(25, quesTwenty);
                          ps.setString(26, quesTwentyOne);
                          ps.setString(27,  stuNumber);
                          ps.executeUpdate();                   
                   conn.commit();
                 conn.setAutoCommit(true);   
                 connectionPool.returnConnection(conn);
        }catch (SQLException e) {
              throw new ServletException(e);
         finally {
              try {
                   if(rs != null)
                        rs.close();
                   if(stmt != null)
                        stmt.close();
                   if(ps != null)
                        ps.close();
                   if(conn != null)
                        conn.close();
                   connectionPool.returnConnection(conn);
              } catch (SQLException e) {}
    } // end doPost
    public String getServletInfo()
        return "A Simple Servlet";
    }// end of ContrInsert

    The way to do this with a JSP is use an HTML Form tag to pass all the information on to a new page, and save the new info while creating this new page

  • Using Beans

    I have my JavaBean's full path in my system classpath and am trying to import the bean, but I am unable to access it in a servlet.
    If I have the bean in the com directory under WEB-INF, wouldn't the import be import com.mybean.class; ?
    I'm finding very little on using beans with servlets. What else do I need to do to access the beans methods?
    Thanks.

    I thought about that, but I wasn't sure of the
    implications once I again use the bean in the JSP
    pages that pickup processing from the servlet. Will I
    then have to use the object name to reference the
    session bean?If you are carrying/sharing this bean state with a jsp then, you could do something like this..
    1. Instantiate the bean in your servlet class and do the processing you need to do on it
    2. set this bean as an attribute in request or session
    3. in JSP, use this bean and share the state using the <jsp:useBean .. tag.  PafBean myBean = new PafBean();
      myBean.setMgrNum(username);
      myBean.setSomethingElse(request.getParameter("somethingElse"));
      // here i am setting to request. but you could set it in session also
      request.setAttribute("myBean", myBean);
      getServletConfig().getServletContext().getRequestDispatcher
                               ("/jsp/test.jsp").forward(request, response);The JSP page Bean1.jsp can then process fBean, after first extracting it from the default request scope via the useBean action.
    <jsp:useBean id="myBean" class="com.PafBean" scope="request"/>
    //if you are using session
    <jsp:useBean id="myBean" class="com.PafBean" scope="session"/>Hope this helps!

  • How can i use my custom login page in a custom partner application ?

    Dear All,
    I'm trying to customize a login page displayed other than the default sso login page
    by submiting my form to the regular pl/sql procedure : "PORTAL.wwptl_login.login_url"
    but i tried to type the requested partner application url in the browser i got the sso
    login page other than my custom login page. So, How can i use my custom login page in a custom partner application ?
    Regards,
    Mohammed Amin
    [email protected]

    I cannot begin to express my level of frustration. I have been trying to use the composition widget light box display for some time now. I drag the widget to my document. The default widget has three small trigger boxes and a large area made up of a forward and backward button, a background, a text box and a frame for your image.
    My steps have been …
    I click on the little trigger box.
    I click on the frame that holds the main image.
    I go to the fill menu and browse my computer for my image and then click OK.
    IT shows up on my screen. Yay
    I attempt to continue using the next two trigger boxes provided in the widget.
    After that, I add more by clicking on the little plus sign.
    This is where all heck breaks loose.
    Every single time I attempt to add thumbnails, something messes up. When I go to preview, either not all of my main images show up, or it starts with the wrong one, or some are missing. I have looked and looked for help on this and the only thing I can find is how easy it is to create a great portfolio lightbox display.  But as we know, that only works when your thumbnails are the same image as the images in your lightbox. If you want something different, you have to use the composition wizard. I am finding it extremely difficult and confusing to customize.
    Is there an exact sequence you need to use to add images to the slideshow? I am my wits end.

  • How to  populate the List for  second LOV using bean

    hi how can i pass selected value of LOV to second LOV using bean,so can have cascading lov,my lov are as followss,am in jdeveloper 11.1.1.6.0
    <td width="50%" height="22"><af:selectOneChoice
                                            label="#{bindings.LutOrganisationtypesView1.label}"
                                            required="true"
                                            shortDesc="#{bindings.LutOrganisationtypesView1.hints.tooltip}"
                                            id="soc2" simple="true"
                                            autoSubmit="true"
                                            immediate="true"
                                            binding="#{pageFlowScope.orgDetailsBean.orgCat}"
                                            value="#{pageFlowScope.orgDetailsBean.orgCat}"
                                            attributeChangeListener="#{pageFlowScope.orgDetailsBean.listener}"
                                            rendered="true" valuePassThru="true">
                         <af:forEach items="#{bindings.LutOrganisationtypesView1.iteratorBinding.allRowsInRange}"
                                      var="row">
                            <af:selectItem id="tiltco2" label="#{row.description}"
                                           value="#{row.organisationtypecode}"/>
                          </af:forEach>                
                        </af:selectOneChoice>
                      </td>
                    </tr><tr>
                      <td width="50%" height="22">
                        <af:outputLabel value="Type" id="ol5" showRequired="true"/>
                      </td>
                      <td width="50%" height="22"><af:selectOneChoice
                                            label="#{bindings.LutOrgsubtypesView1.label}"
                                            required="true"
                                            shortDesc="#{bindings.LutOrgsubtypesView1.hints.tooltip}"
                                            id="soc1" simple="true"
                                            autoSubmit="false"
                                            partialTriggers="soc2"
                                            immediate="false"
                                            binding="#{pageFlowScope.orgDetailsBean.orgSubtype}"
                                            value="#{pageFlowScope.orgDetailsBean.orgSubtype}"
                                            rendered="true">
                                          <af:forEach items="#{bindings.LutOrgsubtypesView1.iteratorBinding.allRowsInRange}"
                                      var="row">
                            <af:selectItem id="tiltcos2" label="#{row.orgsubtypename}"
                                           value="#{row.orgsubtypecode}"/>
                          </af:forEach>     
                        </af:selectOneChoice>
                      </td>when i select my list i only get one list in second lov it does not show the other selection
    Edited by: adf0994 on 2012/11/08 12:49 PM
    Edited by: adf0994 on 2012/11/08 12:55 PM

    i have this value change listner but still no luck
    private String orgSubtype;
        public void setOrgSubtype(String orgSubtype) {
            this.orgSubtype = orgSubtype;
        public String getOrgSubtype() {
            return orgSubtype;
            public void GetOrg(ValueChangeEvent valueChangeEvent) {
            orgSubtype  = valueChangeEvent.getNewValue().toString();
            refereshpage();
        public void refereshpage(){
            FacesContext facesContext = FacesContext.getCurrentInstance();
            String Refreshpage = facesContext.getViewRoot().getViewId();
            ViewHandler  viewHandler = facesContext.getApplication().getViewHandler();
            UIViewRoot viewroot =  viewHandler.createView(facesContext, Refreshpage);
            viewroot.setViewId(Refreshpage);
            facesContext.setViewRoot(viewroot);
        }i get this error
    Caused By: java.lang.IllegalArgumentException: Cannot convert PRIV of type class java.lang.String to class javax.faces.component.UIComponent
         at com.sun.el.lang.ELSupport.coerceToType(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:250)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:513)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:782)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:71)
         at oracle.adfinternal.view.faces.unified.taglib.input.UnifiedSelectOneChoiceTag.doStartTag(UnifiedSelectOneChoiceTag.java:51)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
         at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
         at oracle.jsp.runtime.tree.OracleJspIterationTagNode.executeHandler(OracleJspIterationTagNode.java:45)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
         at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
         at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:422)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:810)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:734)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:444)
         at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
         at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:184)
         at oracle.adfinternal.view.faces.taglib.region.IncludeTag.__include(IncludeTag.java:442)
         at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:153)
         at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:128)
         at oracle.adf.view.rich.component.fragment.UIXRegion.processRegion(UIXRegion.java:503)
         at oracle.adfinternal.view.faces.taglib.region.RegionTag.doStartTag(RegionTag.java:127)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
         at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
         at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
         at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
         at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:422)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:810)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:734)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
         at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:469)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:911)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:367)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:222)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101017 MACHINE = srd-ws23042 TXID = CONTEXTID = f43e1d034e2e3af8:-7fc86077:13ae01cb0a4:-8000-0000000000000056 TIMESTAMP = 1352380663628
    WatchAlarmType: AutomaticReset
    WatchAlarmResetPeriod: 30000
    >
    my LOV IS
    <af:selectOneChoice
                                            label="#{bindings.LutOrganisationtypesView1.label}"
                                            required="true"
                                            shortDesc="#{bindings.LutOrganisationtypesView1.hints.tooltip}"
                                            id="soc2" simple="true"
                                            autoSubmit="true"
                                            immediate="true"
                                            binding="#{pageFlowScope.orgDetailsBean.orgCat}"
                                            value="#{pageFlowScope.orgDetailsBean.orgCat}"
                                            rendered="true"
                                                                      valueChangeListener="#{pageFlowScope.orgDetailsBean.GetOrg}">
                         <af:forEach items="#{bindings.LutOrganisationtypesView1.iteratorBinding.allRowsInRange}"
                                      var="row">
                            <af:selectItem id="tiltco2" label="#{row.description}"
                                           value="#{row.organisationtypecode}"/>
                          </af:forEach>                
                        </af:selectOneChoice>Edited by: adf0994 on 2012/11/08 1:34 PM
    Edited by: adf0994 on 2012/11/08 4:15 PM
    Edited by: adf0994 on 2012/11/08 4:49 PM

  • How to use beans in java application server 8.1?

    i created a bean to use in a jsp page. then i copied the jsp page to "domains/domain1/docroot " directory and the class file to the "domains/domain1/lib/classes" folder. But now i can only access the jsp page the bean is not included in it. how can i do this without using deploying tool?

    Can you repost this question in the AppServer forum?
    http://swforum.sun.com/jive/category.jspa?categoryID=35

  • Problem in exchange data using Bean

    Hi all,
    I have a problem when creating a portal application.
    I've done through the steps described in this link:
    http://www.ajvic.es/irj/portalapps/com.sap.portal.pdk.htmlb.htmlbmanuals/docs/dynpage-01.html
    In this example, I use bean to exchange data.
    In the function <b>doInitialization()</b> in JSPDynpage.java:
    public void doInitialization()
      // create the bean and set a default text value "unknown user
       IPortalComponentRequest request  = (IPortalComponentRequest) this.getRequest();     
       IPortalComponentContext myContext = request.getComponentContext();          
       IPortalComponentProfile myProfile = myContext.getProfile();
       // new bean object  
       UserNameContainer = new DynPageNameBean();
       // set default name
       UserNameContainer.setName("unknown user");
        // store bean in profile for the JSP
        myProfile.putValue("UserNameBean", UserNameContainer);
        // Now we set the state so that we can decide what action to do next
        state = INITIAL_STATE;     
    The code: <b>myProfile.putValue("UserNameBean", UserNameContainer);</b> give a warning: "The methode getValue(String) from the type IPortalComponentProfile is deprecated" and I see that the value of UserNameContainer is <b>not</b> assigned to "UserNameBean".
    If I use this code:
           UserNameContainer = (MyBeanClass) myContext.getValue("MyB");
         UserNameContainer.setName(name);
    The result is the same.
    Do you know how to solve this problem ?
    Thank you in advance & kindly regards.
    Tweety

    Hi
    Here is what you should do.
    First The Bean
    public class UserBean implements Serializable {
    private String name;
    public String getName() {
         return name;
    public void setName(String string) {
         name = string;
    Next the Dynpage DoInitialization Method .
         IPortalComponentRequest request =
                        (IPortalComponentRequest) this.getRequest();
                   UserBean myBean = (UserBean) request.getComponentSession().getValue("myBean");
                   if (myBean == null) {
                        myBean = new UserBean();
                   myBean.setName("Unknown User");
    request.getComponentSession().putValue("myBean",myBean);
    this.state = INITIAL_STATE;
    Next the JSP
    <%@ taglib      uri="tagLib" prefix="hbj" %>
    <jsp:useBean
         id="myBean"
         scope="session"
         class="UserBean"
         />
    <html>
         <hbj:content
              id="myContext">
              <hbj:page
                   title="PageTitle">
                   <hbj:form
                        id="myFormId">
                                                                                              <hbj:textView
                             id="s1" >
                             <%
    s1.setText(myBean.getName());
                             %>
                        </hbj:textView>                    
                   </hbj:form>
              </hbj:page>
         </hbj:content>
    </html>
    Regards
    Rajendra

  • I have lost the use of the 'forward' and 'back' button

    On Win 7 I have lost the use of the forward and back button - both are greyed out - except on this page ??? when I leave this page the greyed out appears on all tabs or links in use. I am using Firefox 3.6.16. To get to this page I have 7 tabs open at present and all ( except this one - odd! ) are greyed out.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    See:
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.com/kb/Firefox+crashes
    If you have submitted Breakpad crash reports then post the IDs of one or more Breakpad crash reports (bp-xxxxxxxx-xxxxxxxxx-xxxx-xxxxxxxxxxxx).
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    You can open the <b>about:crashes</b> page via the location bar, like you open a website.
    See:
    *http://kb.mozillazine.org/Breakpad (Mozilla Crash Reporter)

  • Navigation is not working in forwarded page

    HI ,
    I am forwarding one jsp formatted JSF page to other page . index.jsp to home.jsp like <jsp:forward page="jsf/home.jsp"/> .I am having some af:commandImagelink in home.jsp page which is navigating to other pages .When I am accessing the home.jsp page directly the navigation to other page is working fine but when i am going thru index.jsp then it is staying in the same page .
    Please suggest me if anybody have some idea .
    Thanks
    -Dharmendra

    Dharmendra,
    Are you using ADF task flows? If so, you won't be able to forward to the JSP page directly, but you would need to forward to the task flow activity.
    John

  • Howto use comments in JSF pages

    Hi all,
    I play a little bit with JSF, at the moment. I wonder that I cannot find any information about how to comment out a part of a JSF page, that it is not rendered.
    If I use the html comment tags <!-- --> then this part is already rendered if I access the page.
    If I want to comment out an invalid part, the execution will fails :(.
    So is there a comment tag in JSF, which is not be rendered if a page is access?
    Thank in advance
    Marco

    I'm sure you must have found a way by now, but to anyone who also has this problem (like myself :D) you can do the following.. I'm using Facelets as XHTML pages, and I didn't find a way of allow the JSP style comments:
    <%--    --%>But if you add the below to your web.xml, you can allow Facelets to skip HTML comments:
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
      </context-param>So with the above in your web.xml, the below:
    First line: #{person.id}
    <!-- Second Line: #{person.id} -->would generate, assuming the person bean's id property is 5:
    First line: 5

  • Calling Beans from JSP page

    hi,
    I tried to my best to call java beans from JSP page but it generate error that "unable to load class....", please help me that in which directory jsp file and bean *.class file reside, currently my setting are as follows.
    Note: I am using tomcat server and my jsp and servlet files are running seccessfuly, there is any special change in classpath for java beans? if any please tell
    My jsp file is in tomcat-->webapps-->jsp--><my file>
    My bean (*.class) file-->webapps-->Root-->web-inf-->classes--><my file>
    Pleae help me for the above problem.
    Mubashar ([email protected])

    According to J2EE standards:
    The web appl directory structure should be:
    WebAppRootDirectory
    |
    |---html, jsp, images etc
    |
    |---WEB-INF---
    |---classes--
    |---lib
    |
    |
    1) Make sure WEB-INF is in capital letters
    2) Place all ur beans in classes dir or sub-directory in
    classes
    3) In Tomcat place WebAppRootDirectory in webapps
    directory
    [email protected]

  • How do i pass a url with query string using the jsp:forward tag

    This snippet of code gives a 403 error
    <jsp:forward page="testpage.jsp?test=1" />
    How do i rectify it?

    Well better way to go about for the job is to use
    setAttribute("name","value");method in the first page
    and then in next page use method
    String s=getAttribute("name");to retreive the value.
    Url rewritting or using Query String has some disadvantages ,which are handled by above mentioned approach.
    Ashish

Maybe you are looking for

  • Office 2013 Professional Plus - 32 bit Deployment takes an unacceptable time to deploy in SCCM 2012 - SP1 CU3

    We recently migrated over to SCCM 2012 SP1 - CU3 the first of the year from SCCM 2007 SP2.  We have used SCCM in the past to deploy Office 2010 and had deployed Office 2013 to our IT Dept. before moving over to SCCM 2012.  The deployment went as expe

  • Stopping Telemetry

    I turned on telemetry months ago. I believe simply by adding a directory /var/opt/SUNWmsgsr/telemetry/imap/$USERNAME and bouncing the mail server. I found the issue and fixed it. But forgot about the directory. It is now almost 1gig. I believe that j

  • New TED video podcasts not compatible with 80GB classic?

    Up until recently, I've been loading TED podcasts (video) on my 80GB Classic with no problems. For the last 3-4, however, I'm being told that these most recent ones can't sync because they are not compatible with my ipod. For some reason they can't b

  • ABAP Function Module

    Hello Experts, I am working on requirement in which i m facing problem. I have an excel sheet with 5000 records. In which i shud retreive only last 2 charecters of a particular column. can anyoen help me what to write..? Thanks, varun. \[removed by m

  • Where is the new location of the OLAP option DBA sample scripts?

    Hello, OLAP option DBA sample scripts was used to be available on http://wiki.oracle.com/page/OLAP+option+-DBASample+Scripts Thanks, Lajos