Troubles to save EditCurrentRecord bean in request

Hi All!
I have trouble with saving EditCurrentRecord in request. In JDeveloper everything works fine. But when I try to run on iAS with Apache/Jserv I get jsp compilation error:
java.lang.NoSuchMethodError: javax.servlet.ServletRequest: method setAttribute(Ljava/lang/String;Ljava/lang/Object;)V not found
I have this problem with a lot of my pages.
First time I thinks problem is in my code. By after removing every line of my custom code and leaving only JD code, I get the same error. Some pages works fine, another no! They are looks very simillary.
I also take a look at servlet code. It's look great.
Anybody have this problem?

I think that the problem is caused by the iAS, which uses the old version (2.0) of servlet specification, which does not support setAttribute method.
Even though I found the servlet22.jar file in jsp\lib folder I am not sure how to make it the default servlet API in iAS.
Is there a way to solve this problem, since none of the jsp pages which use jbo classes can not be deployed to iAS ?
null

Similar Messages

  • Troubles with save object in request

    Hi All!
    I have trouble with saving EditCurrentRecord in request. In JDeveloper everything works fine. But when I try to run on iAS with Apache/Jserv I get jsp compilation error:
    java.lang.NoSuchMethodError: javax.servlet.ServletRequest: method setAttribute(Ljava/lang/String;Ljava/lang/Object;)V not found
    I have this problem with a lot of my pages.
    First time I thinks problem is in my code. By after removing every line of my custom code and leaving only JD code, I get the same error. Some pages works fine, another no! They are looks very simillary.
    I also take a look at servlet code. It's look great.
    Anybody have this problem?
    null

    Hi Dev,
    Please check the FG 'STRD', it should have FM for your requirement.
    Like FM 'TR_OBJECT_INSERT' or TR_OBJECTS_INSERT etc.
    Best Regards,
    Swanand

  • Can't pass bean or request attribute from servlet to JSP

    Hi,
    I have a web app that starts with a file upload page that uses commons io fileUpload, passes the info on to a servlet. Then the servlet passes its info on to a JSP.
    I can upload the file onto the web app successfully. I also can call that uploaded file directly from the JSP (i.e. bypassing the servlet) without problem. But if I try to chain all 3 together while passing the url for the file directly as an attribute or as a bean containing file's url, I get premature end of file or can't find the property in the bean. I'm not sure what I'm doing wrong.
    the error message:
    org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Premature end of file.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         servlet.UploadServlet.processRequest(UploadServlet.java:329)
         servlet.UploadServlet.doPost(UploadServlet.java:363)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Premature end of file.
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.clinTrialsEditor_jsp._jspService(clinTrialsEditor_jsp.java:144)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         servlet.UploadServlet.processRequest(UploadServlet.java:329)
         servlet.UploadServlet.doPost(UploadServlet.java:363)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.xml.sax.SAXParseException: Premature end of file.
         org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
         org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
         org.apache.jsp.clinTrialsEditor_jsp._jspx_meth_x_parse_0(clinTrialsEditor_jsp.java:189)
         org.apache.jsp.clinTrialsEditor_jsp._jspService(clinTrialsEditor_jsp.java:88)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         servlet.UploadServlet.processRequest(UploadServlet.java:329)
         servlet.UploadServlet.doPost(UploadServlet.java:363)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    Code from the servlet:
    String dName = "http://localhost:8084/fileUploadApp/faces/";
    url = dName + fileName;
    beans.FileInfo.setFileName(fileName);
    request.setAttribute("fileInfo", new FileInfo());
    beans.FileInfo.setDName(dName);
    beans.FileInfo.setDirName(dirName);
    beans.FileInfo.setUrl(url);
    File saveTo = new File(dirName + fileName);
    //if I use the next 2 lines I get "can't resolve symbol - create field, local var or parameter FileInfo"
    FileInfo fileInfo = new beans.FileInfo();
    request.setAttribute("fileInfo", FileInfo); //error here
    request.setAttribute("myUrl", url);
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/clinTrialsEditor.jsp");
    dispatcher.forward(request, response);
    on JSP
    <jsp:useBean id="fileInfo" class="beans.FileInfo" scope="request"/>
    <jsp:setProperty name="fileInfo" property="*"/>
    <%--<c:import url="http://localhost:8084/fileUploadApp/faces/lowVision.xml" var="url" /> --%> <c:import url="${myUrl}" var="url" />
    <x:parse xml="${url}" var="clin" />
    etc...x:set with xpath expressions
    Can anyone spot my error(s)?
    Thanks for the help!

    Thanks for your reply, Ram.
    I made the change but I get an error "Unable to find a value for "fileName" in bean of type beans.FileInfo"
    Here's the bean:
    package beans;
    public class FileInfo {
    private static String fileName;
    private static String dirName;
    private static String dName;
    private static String url;
    /** Creates a new instance of FileInfo */
    public FileInfo() {
    public static void setFileName(String fn){
    fileName = fn;
    public static String getFileName(){
    return fileName;
    public static void setDirName(String dn){
    dirName = dn;
    public static String getDirName(){
    return dirName;
    public static void setDName(String d){
    dName = d;
    public static String getDName(){
    return dName;
    public static void setUrl(String u){
    url = u;
    public static String getUrl(){
    return url;
    Pertinent parts of servlet:
    String dirName = "C:/MyNBProjects/fileUploadApp/web/"; //save file to web app then convert to url so it can be called to show it on next page
    String dName = "http://localhost:8084/fileUploadApp/faces/";
    url = dName + fileName;
    FileInfo fileInfo = new FileInfo();
    fileInfo.setFileName("fileName");
    fileInfo.setDName("dName");
    fileInfo.setDirName("dirName");
    fileInfo.setUrl("url");
    request.setAttribute("fileName", fileName);
    request.setAttribute("url", url);
    request.setAttribute("fileInfo", fileInfo);
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/clinTrialsEditor.jsp");
    dispatcher.forward(request, response);
    jsp:
    <jsp:useBean id="fileInfo" class="beans.FileInfo" scope="request"/>
    <jsp:setProperty name="fileInfo" property="*"/>
    url = <c:out value="${url}" />
    //works; not part of bean
    fileName = <c:out value="${fileName}" />
    //works; not part from the bean
    fileInfo.fileName = <jsp:getProperty name="fileInfo" property="fileName" />
    //doesn't work
    <%--fileName = <c:out value="${fileInfo.fileName}" /> //doesn't work
    Can you spot the error(s)?
    Thanks for your help.

  • Getting bean from request scope

    Hi,
    I am new to JSF and unfortunately I am running into a problem that I am not entirely sure about. I look in other forums and what I am doing looks right but I am not getting the desired result.
    In my faces-config.xml file I have a managed bean defined as follows:
    <managed-bean>
        <managed-bean-name>LogIn</managed-bean-name>
        <managed-bean-class>lex.cac.tables.RefUsers</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>I then have a log on page with a form which contains a user name and password field. The tags are defined as
    <h:inputText immediate="false" value="#{LogIn.username}" /> (for username) and
    <h:inputSecret immediate="false" required="true"
                                   value="#{LogIn.password}" /> (for password)
    When I submit the form the web app navigates to a jsp page which attempts to do validation against a database.
    The first step though is retrieving the object which is suppose to be in request scope.
    I attempt the following but I get back null which causes a NullPointerException. Why can't if find the bean?
    ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
    Map params         = ec.getRequestParameterMap();
    params.get("LogIn");  //null is returned hereWhat am i doing wrong? Can someone please help.
    Thanks in advance,
    Alex.

    Something like that:
    FacesContext fc = FacesContext.getCurrentInstance();
    RefUsers LogIn = (RefUsers)fc.getApplication().createValueBinding("#{LogIn}").getValue(fc);
    String username = LogIn.getUsername();
    String password = LogIn.getPassword();

  • Have a backing bean in request scope; need to access parameters sent to it

    I have a request scope backing bean in my app, 'projectBean'. This has a property called 'id'.
    /** in request scope in faces-config.xml */
    projectBean {
        id               // set by the param from the previous page
        downloadAction() // activated by commandlink, depends on id
    }There is another backing bean in session scope called 'projectListingBean', which has a dataTable that lists a bunch of projectBeans. In this 'projectListingBean', I can click on any row. That row, when clicked initializes a 'id' parameter, which is then passed to the new 'projectBean'. 'projectBean' then initializes itself based on the id.
    In the jsp page backed by 'projectBean', I also have a link to download something specific to that 'projectBean'. Naturally enough, I have a commandlink with actionBinding to a method in my 'projectBean', downloadXXXAction().
    The problem arises because the downloadXXX() method relies on a 'id'. Remember, this id was orinigally set 2 requests back from the datatable. Since the page backed by 'projectBean' is in request scope, the id is lost, and my method call doesn't work. I tried changing the scope of 'projectBean' to session, but JSF complains that I already setting the 'id' property as a param, I can't set the whole managed bean to something 'higher' like session.
    Of course, the ideal fix to this probelm would be the ability to have beans in page scope, but what other ways (hacks??) are there to get around this?

    Hi, I'm posting some code snippets if it helps with understanding the problem.
    faces-config.xml:
    <!-- PROJECTLISTINGBEAN -->
    <managed-bean>
         <managed-bean-name>projectListingBean</managed-bean-name>
         <managed-bean-scope>session</managed-bean-scope>
         <managed-property>
              <property-name>projectBeans</property-name>
              <property-class>java.util.List</property-class>
              <list-entries>
                   <value-class>
                        com.sun.sleuth.omcmweb.view.bean.ProjectBean
                   </value-class>
              </list-entries>
         </managed-property>
    </managed-bean>
    <!-- PROJECTBEAN -->
    <managed-bean>
         <managed-bean-name>projectBean</managed-bean-name>
         <managed-bean-class>
         </managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>
              <property-name>projectId</property-name>
              <property-class>java.lang.String</property-class>
              <value>#{param.projectId}</value>
         </managed-property>
    </managed-bean>projectlsting.jsp (page backed by projectListingBean)
    <h:dataTable value="#{projectListingBean.projectBeans}"
         var="projectBean" ...>
         <h:column>
              <f:facet name="header">
              </f:facet>
              <h:commandLink action="#{projectListingBean.viewProjectSUmmary}">
                   <h:outputText value="#{projectBean.projectId}" />
                   <f:param name="projectId" value="#{projectBean.projectId}" />
              </h:commandLink>
         </h:column>
    </h:dataTable>projectsummary.jsp (page backed by request scoped projectBean)
    <h:commandLink action="#{projectBean.assessmentAction}" value="..." />
    ...Flow:
    projectlisting.jsp (projectListingBean - session) -param id passed->
    projectsummary.jsp (projectBean - request) -commandLink clicked and id lost-->
    projectSummary.jsp (projectBean - request)

  • Communicating between beans in request scope

    I have list.jsp that has a table of items with a link to edit each item like so
    <h:dataTable value="#{list.model}" var="curItem">
        <h:commandLink actionListener="#{item.doActionEdit}" action="edit">
          <h:outputText value="#{curItem.id}"/>
          <f:param name="id" value="#{curItem.id}"/>
        </h:commandLink>
    </h:dataTable>edit is map to item.jsp
    when i click on the link the item bean gets called and doActionEdit sets up the id and fetches data from db but then the bean gets recreated (from scratch and all data is lots id is unset) and it loads item.jsp with and empty bean.
    This only happens when item bean is in request scope, however when it is in session scope it works fine, which brings the question; how can I pass objects to a bean that is in the request scope?
    I have tries to map id of item in faces-config.xml with #{param.id} which works fine if id is passed but fails with a npe when item.jsp loads without id (say I want to create a new item.)
    Please advise me what is the best approach to communicate between beans in request scope, so it will work with and without id being passed.

    here is doActionEdit, basicly it gets the id param and then calls setId which tries to load data from db if id is >0 if that fails or id is <=0 it creates new data object instead.
    when the item bean is in session scope the constructor is called once but if the scope is request it is called twice (first time doActionEdit is called after constructor but the 2nd time only constructor is called and the itemData is empty.
         public void doActionEdit(final ActionEvent event) {
                    int id = 0;
              try {
                   id = Integer.parseInt(FacesUtil.getParameter("id"));
              } catch (Exception e) {
                   e.printStackTrace();
              setId(id);
    private ItemData data = null;
         public void setId(final int id) {
              if (id > 0) {
                   data = DB.getItemData(id); //load data from db
                   if (data == null) {
                        data=new Data();
              else {          
                   data=new Data();
         public Item() {
              data=new Data();
              System.out.println("Loading Item class");
         }

  • How to resolve this error - "Cannot save the illustration The requested transformation would make.."

    Hello Adobe Community,
    I am trying to organize some album artwork within a pre-designed template and I keep getting this error when trying to save the file in the eps file format:
    Cannot save the illustration The requested transformation would make some objects fall completely off the drawing area.
    All the art is within the bleed lines. The only transformation I did was rotating one of the pieces 180 degrees. I'm not exactly sure what it is referring to when illustrator says objects are going to completely fall off the drawing area.
    Your insights would be appreciated.
    Thank you!
    Chris

    Did you use Guides at all? From the View menu, choose Guides>Clear Guides. Then zoom way out and do a Select All and see if there any stray points near the borders of the artboard. Direct select them and delete. Then try your transformation.

  • How to decide when to keep backing bean in request and session.Pros/cons

    How to decide when to keep backing bean in request and session.Pros/cons

    Depends on where the bean data must be available. Start with request scope. If you need the data in session scope, then think twice about impacts (memory usage, multiple browser tabs, etc) unless the data is obviously targeted on the session scope (loggedin user, user settings, dropdown data, etc).

  • Where do i save my beans in tomcat?

    hi
    I'm learning java beans and i'm relatively new to it. My jsp code is
    <jsp:useBean id= "stringBean"  class = "example.StringBean">
    <jsp:setProperty name="stringBean" property="message" value="messg"/>
    </jsp:useBean>
    <html>
    <head><title>Using Java Beans in  a JSP page </title></head>
    <body bgcolor = "blue">
    <h3>The msg obtained by using a bean component is :</h3>
    <font size = "5"><jsp:getProperty name="stringBean"  property="message" />
    </body>and the bean StringBean.java is
    package example;
    public class StringBean {
         private String message = " No message " ;
         public String getMessage() {
              return (message);
         public void setMessage(String message)
              this.message = message;
    }Whenver i run the jsp page i get an error as follows
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /beans.jsp(1,1) The value for the useBean class attribute example.StringBean is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3284)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Can someone please help as to where do i save my class file in tomcat??

    I've also had this problem (sorry for resurrecting an old question) and I put my class in the classes folder last night (within a folder appropriately named for the package it's in) and I got the same message as above, even after restarting the web application. Do I need to restart anything else or tell Tomcat where the bean is?
    Cheers
    -- Kev
    Just searched for different terms and found that my class needs a public default constructor. Seem to have missed that part ;�)
    Message was edited by:
    KevDGill

  • Initialize managed bean from request parameters

    Hi:
    I thought this topic would be on the FAQ, but I couldn't find it. I am looking for a mean to initialize my managed bean from the query string. There must be something like:
    <h:form initializeBean=""true"" requestParameter=""id_author"" beanProperty=""#{author.id_author}"" action=""#{author.getFromDB}"" >
    </form>
    The url would be something like http://localhost:8080/protoJSF/showAuthor.jsf?id_author=5334
    And the getFromDB method would be something like
      Public void getFromDB()
         Statement stmt = cn.createStatement( ?SELECT * from author where id_author=? + getId_author() );
         ResultSet rs = stmt.executeQuery();
      }The only way I've found to perform something like this is to present a blank author form with a ''load data'' button: after pressing the button the user can see author's data and edit the data if she wants to. This two-step data screening is annoying, to say the least.
    There must be a better way.
    I beg for a pointer on how can I achieve the initializing of a managed bean with dynamic data.
    Regards
    Alberto Gaona

    You just have to read carefully the very fun 289 pages
    specification :-)Or, if 289 pages of JavaServer Faces is too much, you can get almost all of the same information from the JavaServer Pages 2.0 specification, or even the JSP Standard Tag Libraries specification :-).
    More seriously, the standard set of "magic" variable names that JavaServer Faces recognizes is the same as that reognized by the EL implementations in JSP and JSTL. Specifically:
    * applicationScope - Map of servlet context attributes
    * cooke - Map of cookies in this request
    * facesContext - The FacesContext instance for this request
    * header - Map of HTTP headers (max one value per header name)
    * headerValues - Map of HTTP headers (String array of values per header name)
    * initParam - Map of context initialization parameters for this webapp
    * param - Map of request parameters (max one value per parameter name)
    * paramMap - Map of request parameters (String array of values per parameter name)
    * requestScope - Map of request attributes for this request
    * sessionScope - Map of session attributes for this request
    * view - The UIViewRoot component at the base of the component tree for this view
    If you use a simple name other than the ones on this list, JavaServer Faces will search through request attributes, session attributes, and servlet context (application) attributes. If not found, it will then try to use the managed bean facility to create and configure an appropriate bean, and give it back to you.
    For extra fun, you can even create your own VariableResolver that can define additional "magic" variable names known to your application, and delegate to the standard VariableResolver for anything else.
    Craig McClanahan

  • Creation of a Managed Bean in Request Scope?

    Is there an easy way to create an instance of a managed bean (configured in faces-config.xml) that was configured to be in the Request scope?
    If a JSP refers to it by id, then it will be there.
    However, when the JSP does not refer to it, it will not be in the request. I find I need to generate it anyway to use it from within another Managed Bean. I can extract out the faces-config information from the application map (available from FacesContext) and build it manually -- but this ties me to a particular JSF implementation (and probably version, too).
    Is there a more standardized way to do this?
    Thanks,
    ken

    BTW -- I mean to do this from within Java code (not jsp), and the page being rendered does not have a direct reference to the request-scoped managed bean via value binding.

  • BI Beans Mass requests

    Hello,
    Does anyone know what to do for the following scenario -
    I have a jsp application that includes BI Beans graphs
    and outputs as PDF and saves the file.
    I call this jsp application multiple times in succession
    without a browser -using HTTPClient.
    After being called and generating about 15 times I get the
    following exception:
    oracle.dss.datautil.client.ManagerFactoryException: BIB-18007 A MetadataManager exception has occurred.
    oracle.dss.metadataManager.common.MetadataManagerException: BIB-10100 Cannot connect to the database. (Reason: See error BIB-16613)
    at oracle.dss.datautil.client.XMLManagerFactory.createQueryManager(XMLManagerFactory.java:200)
    at oracle.dss.datautil.client.ManagerFactoryImpl.lookupQueryManager(ManagerFactoryImpl.java:178)
    at oracle.dss.datautil.client.ManagerFactoryImpl.lookupMetadataManager(ManagerFactoryImpl.java:221)
    at oracle.dss.datautil.client.ManagerFactoryImpl.lookupManager(ManagerFactoryImpl.java:128)
    at oracle.dss.addins.thin.common.BaseThinSession.getMetadataManager(BaseThinSession.java:217)
    at oracle.dss.addins.thin.common.BaseThinSession.getQueryManager(BaseThinSession.java:253)
    at oracle.dss.addins.jspTags.TagRequestHandler.getStateManager(TagRequestHandler.java:781)
    at oracle.dss.addins.jspTags.BIThinSession.getStateManager(BIThinSession.java:61)
    at oracle.dss.addins.thin.common.BasePresentationHandler.createBIThinObject(BasePresentationHandler.java:296)
    at oracle.dss.addins.jspTags.PresentationTag.createThinObject(PresentationTag.java:234)
    at oracle.dss.addins.jspTags.BIBaseTag.getThinObject(BIBaseTag.java:79)
    at oracle.dss.addins.jspTags.PresentationTag.doStartTag(PresentationTag.java:258)
    at org.apache.jsp.BlendPreview_jsp._jspService(BlendPreview_jsp.java:233)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
    Does anyone have any similar experiences/ideas/solutions?
    Thanks!

    I would check the database alert log for more information, this could be caused by any number of reasons - you might be running out of session memory, cursors, processes etc etc.
    Keith Laker
    Oracle EMEA Consulting
    OLAP Blog: http://oracleOLAP.blogspot.com/
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    DM Blog: http://oracledmt.blogspot.com/
    OWB Blog : http://blogs.oracle.com/warehousebuilder/
    OWB Wiki : http://wiki.oracle.com/page/Oracle+Warehouse+Builder
    DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html

  • How to save the bean area content to the database

    DB version:10g
    forms version:10g
    Hi Guys,
    I have used text editor PJC/java bean in my screen where i have attched it to "bean area" field.Iam able to do all the changes to the to the text entered in this "bean area" but when i save this in the database it says no changes to save.in my table the column type is Varchar2.
    any ideas of how to save the changes of a bean area to the database???
    regards

    @François Degrelle -Ya frank i have already checked Get_Custom_Property() but the problem is this is returning the HTML code like
    html>
    <head>
    </head>
    <body>
    This is a <b>styled</b> (<i><u>HTML</u></i>) text<br><b><font color="#0066FF" face="Arial">
    displayed</font></b> and <b><font color="#008000" face="Arial">edited</font></b><br>
    in an <b><font color="#FF0000" face="Arial">Oracle Forms</font></b> application
    </body>
    </html>
    but want the data to be in the formatted so that i can store the data in the column and retrieve formatted text into the text field so that user can see only the formatted text that is lets say
    shdjshdsjdsdsdlas -original text
    shdjshdsjdsdsdlas -formatted text
    now i want to strore shdjshdsjdsdsdlas this text into teh database so that when i retrieve shdjshdsjdsdsdlas this data should be shown.
    regards
    Edited by: user123 on May 27, 2011 4:22 PM

  • Trouble when embedding a Bean in an Office Document

    Hello all,
    I have to embed a Java Bean into an ActiveX Container like a MS Office document via the axbridge.
    Let me mention, what I have (successfully) done so far:
    - Create a Java Bean
    - Create a Jar file (incl. the manifest file)
    - Run the packager and register the Object
    - Test the control in the MS ActiveX Control Test Container
    System: Win2k, JSDK 1.4.2, JRE 1.4.2_03, Office 2000, Visual C++ 6.0 SP 3
    The ActiveX control works fine in the MS test container. When I try to embed it in another Container like a MS Office document or Macromedia Authoware, the Container Program hangs up without an error message. Also the Java Console contains no message.
    On the other side, the Control can successfully be created and used within VBA:
    Sub myTestApplet()
        Set myTest = CreateObject("TestApplet.Bean.1")
        �
        Set myTest = Nothing
    End Sub Doing so, the control works correctly, but isn�t displayed in the document.
    I tried to use different Superclasses for the Bean like Component, JComponent, Panel etc. and at last I used an empty Bean inherited from JComponent. Every try works well in the MS test container, but as soon as I try to embed it into an Office-Document the Application hangs up.
    The ActiveX Bridge from the 1.4.2 SDK/JRE Bundle doesn�t work at all, even not in the MS test container. Thus I installed the 1.4.2_03 JRE, which makes the controls work in the MS test container (but still not in other Containers).
    Can somebody help me? I have no idea for a workaround and I�m blocked now. Any advice is very welcome!
    Regards,
    Oliver

    Thank you very much for your interest at my problem.
    I try to describe exactly, what I do: I want to integrate a Java3D program into a Macromedia Authorware application. Therefore I want to convert the Java3D program into an ActiveX control (and use the ActiveX Bridge). Authorware must be able to access methods of the J3D program and the J3D program must be able to throw events to Authorware. I think this is nothing special for an ActiveX control.
    In order to avoid additional problems, I use a simple test application without Java3D (source code enclosed).
    I work on:
    WindowsXP,
    JSDK 1.4.2, JRE 1.4.2_3,
    Visual C++ 6.0 SP3 and I also tried Visual Studio .NET.
    Authorware 7
    MS Office 2000
    What have I done so far?
    - compiled the code and created a jar archive (manifest file enclosed)
    - packaged and registered the Bean as described in http://java.sun.com/j2se/1.4.2/docs/guide/beans/axbridge/developerguide/index.html
    - successfully tested the ActiveX control in the ActiveX Control Test Container. The exported methods appear (and work) correctly when I choose "invoke methods".
    Now to the problem(s): If I try to embed the control in Authorware or an office document via the ToolBox, the container program hangs up. But as already mentioned above, Visual Basic .NET embeds the control successfully. Therefore I try to create an ActiveX control in VB .NET, which integrates my Java Bean. Let's say a wrapper control. Here are the steps:
    - I opened Visual Studio .NET and created a new VB project based on template "Windows Application".
    - added the Bean to the ToolBox
    - added the Bean into the VB Form.
    - added a button into the form. The form designer created the Bean and button as:Friend WithEvents AxActiveXTest1 As AxActiveXTest.AxActiveXTest
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Me.AxActiveXTest1 = New AxActiveXTest.AxActiveXTest()
    Me.Button1 = New System.Windows.Forms.Button() - in the form designer double clicked the button and entered the following code: Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.AxActiveXTest1.appendText("Hello World")
    End Sub- test the form and click on the VB button.
    Now the error message listed above appears ("cannot invoke method 'appendText' at this time"). I have no idea, why VB crashes when I try to access a method of the Bean. Somewhere I must have made an error. Each assistance is very welcome.
    Thank you in advance and please excuse my less good English.
    Oliver
    Source code:
    1. Class ActiveXTest package de.acns.test;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.beans.*;
    import java.io.*;
    * class ActiveXTest
    public class ActiveXTest extends JPanel implements Serializable,
                                                       PropertyChangeListener
        // member variables
        private PropertyChangeSupport propertySupport;
        /** Creates new form ActiveXTest */
        public ActiveXTest() {
            propertySupport = new PropertyChangeSupport( this );
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            jButton1 = new javax.swing.JButton();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTextArea1 = new javax.swing.JTextArea();
            setLayout(new java.awt.GridBagLayout());
            jButton1.setText("Click Here!");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
            add(jButton1, gridBagConstraints);
            jScrollPane1.setMinimumSize(new java.awt.Dimension(160, 100));
            jScrollPane1.setPreferredSize(new java.awt.Dimension(160, 100));
            jTextArea1.setPreferredSize(new java.awt.Dimension(50, 50));
            jScrollPane1.setViewportView(jTextArea1);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
            add(jScrollPane1, gridBagConstraints);
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            // Add your handling code here:
            appendText("You clicked the java button.\n");
         * Public methods to export
        public void appendText( String text)
            jTextArea1.append(text);
        public void setText( String text )
            String oldValue = jTextArea1.getText();
            jTextArea1.setText( text );
            propertySupport.firePropertyChange("TEXT", oldValue,
                                               jTextArea1.getText());
        public String getText()
            return jTextArea1.getText();
         * PropertyChangeListener Support
        public void addPropertyChangeListener(PropertyChangeListener listener) {
            propertySupport.addPropertyChangeListener(listener);
        public void removePropertyChangeListener(PropertyChangeListener listener) {
            propertySupport.removePropertyChangeListener(listener);
         * static main method, enables the bean to be testet "standalone"
        public static void main( String[] args)
            // Create a new instance and add it to a JFrame
            ActiveXTest activeXTest = new ActiveXTest();
            JFrame      frame       = new JFrame("Testapplication");
            activeXTest.addPropertyChangeListener(activeXTest);
            frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE);
            frame.addWindowListener(new WindowAdapter()
                public void windowClosing( WindowEvent e )
                    System.exit(0);
            frame.getContentPane().setLayout( new GridLayout ());
            frame.getContentPane().add( activeXTest );
            frame.validate();
            frame.pack();
            frame.setLocation( (Toolkit.getDefaultToolkit().getScreenSize().width 
                                 - frame.getWidth())  >> 1,
                               (Toolkit.getDefaultToolkit().getScreenSize().height
                                 - frame.getHeight()) >> 1 );
            frame.show();
         * For testing purposes only, when the bean is
         * created by the static main method
        public void propertyChange(PropertyChangeEvent evt)
            System.out.println("Property \"" + evt.getPropertyName()
                                + "\" wurde von \"" + evt.getOldValue()
                                + "\" in \"" + evt.getNewValue()
                                + "\" ge?ndert");
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextArea jTextArea1;
        // End of variables declaration
    } 2. ActiveXTestBeanInfopackage de.acns.test;
    import java.beans.*;
    * class ActiveXTestBeanInfo
    public class ActiveXTestBeanInfo extends SimpleBeanInfo {
        // Bean descriptor information will be obtained from introspection.
        private static BeanDescriptor beanDescriptor = null;
        private static BeanDescriptor getBdescriptor(){
            // Here you can add code for customizing the BeanDescriptor.
            return beanDescriptor;     }
        // Properties information will be obtained from introspection.
        private static PropertyDescriptor[] properties = null;
        private static PropertyDescriptor[] getPdescriptor(){
            // Here you can add code for customizing the properties array.
            System.out.println("ActiveXTestBeanInfo: Properties werden exportiert:");
            try
                // create the property descritpors
                properties = new PropertyDescriptor[]
                    new PropertyDescriptor( "text", de.acns.test.ActiveXTest.class )
                // For debugging purposes only
                for( int i=0; i<properties.length; i++)
                    System.out.println(properties.getShortDescription() );
    System.out.println(" ");
    catch( Exception e )
    e.printStackTrace();
    return properties; }
    // Event set information will be obtained from introspection.
    private static EventSetDescriptor[] eventSets = null;
    private static EventSetDescriptor[] getEdescriptor(){
    // Here you can add code for customizing the event sets array.
    return eventSets; }
    // Method information will be obtained from introspection.
    private static MethodDescriptor[] methods = null;
    private static MethodDescriptor[] getMdescriptor(){
    // Here you can add code for customizing the methods array.
    System.out.println("ActiveXTestBeanInfo: exportiere Methoden:");
    try
    // create the method descriptors
    methods = new MethodDescriptor[]
    new MethodDescriptor( ActiveXTest.class.getMethod("appendText", new Class[]{String.class}))
    // For debugging purposes only
    for( int i=0; i<methods.length; i++)
    System.out.println(methods[i].getName());
    System.out.println(" ");
    catch( Exception e)
    e.printStackTrace();
    return methods; }
    private static int defaultPropertyIndex = -1;
    private static int defaultEventIndex = -1;
    // Here you can add code for customizing the Superclass BeanInfo.
    * Gets the bean's <code>BeanDescriptor</code>s.
    * @return BeanDescriptor describing the editable
    * properties of this bean. May return null if the
    * information should be obtained by automatic analysis.
    public BeanDescriptor getBeanDescriptor() {
    return getBdescriptor();
    * Gets the bean's <code>PropertyDescriptor</code>s.
    * @return An array of PropertyDescriptors describing the editable
    * properties supported by this bean. May return null if the
    * information should be obtained by automatic analysis.
    * <p>
    * If a property is indexed, then its entry in the result array will
    * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
    * A client of getPropertyDescriptors can use "instanceof" to check
    * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
    public PropertyDescriptor[] getPropertyDescriptors() {
    return getPdescriptor();
    * Gets the bean's <code>EventSetDescriptor</code>s.
    * @return An array of EventSetDescriptors describing the kinds of
    * events fired by this bean. May return null if the information
    * should be obtained by automatic analysis.
    public EventSetDescriptor[] getEventSetDescriptors() {
    return getEdescriptor();
    * Gets the bean's <code>MethodDescriptor</code>s.
    * @return An array of MethodDescriptors describing the methods
    * implemented by this bean. May return null if the information
    * should be obtained by automatic analysis.
    public MethodDescriptor[] getMethodDescriptors() {
    return getMdescriptor();
    * A bean may have a "default" property that is the property that will
    * mostly commonly be initially chosen for update by human's who are
    * customizing the bean.
    * @return Index of default property in the PropertyDescriptor array
    *           returned by getPropertyDescriptors.
    * <P>     Returns -1 if there is no default property.
    public int getDefaultPropertyIndex() {
    return defaultPropertyIndex;
    * A bean may have a "default" event that is the event that will
    * mostly commonly be used by human's when using the bean.
    * @return Index of default event in the EventSetDescriptor array
    *          returned by getEventSetDescriptors.
    * <P>     Returns -1 if there is no default event.
    public int getDefaultEventIndex() {
    return defaultEventIndex;
    3. manifest file manifest.mf
    Manifest-Version: 1.0
    Name: de/acns/test/ActiveXTest.class
    Java-Bean: True

  • Trouble with saveAS

    I am having a problem with a javascript function. <br /><br />I can save as a Tiff with no problem - <br />but now I would like to have another option that allows my users to save data as a PDF file. <br /><br />I can't seem to get it to work for a PDF file. <br /><br />The save as TIFF syntax - works fine ..  <br />CODE SNIPPET HERE !<br /><this.saveAsFile,"com.adobe.acrobat.tiff"); ><br /><br />I have tried leaving out a conversion that doesn't work . <br />I have tried preflight conversions - they don't work - bcause the preflight dll is non-existent . <br /><br />is there an easy solution that I am overlooking ?

    Well, the syntax for saveAs in Acrobat JavaScript is actually
    this.saveAs(path, conversionID)
    So try that syntax, unless you have a folder-level function defining "saveAsFile", in which case we'd need to see that function to know what's going on.

Maybe you are looking for