Can't us Oracle API on the simple JSP pages added to the portlet........

Hi,
I added a jsp page in the portlet which is not a standard page like the default show mode pages. I have added some code which actually access a resource inside the porltet.
" img src="<%= UrlUtils.constructResourceURL (pReq, HttpPortletRendererUtil .absoluteLink(request, "icon.png")) %> "
For that you have to add the following two imports in the code
mport="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"
import="oracle.portal.provider.v2.url.UrlUtils"
This library is available with the JDeveloper and I dont get any error while compiling and even deploying the portlet war file on the applcation server. Strangely the same piece of code shows the image perfectly for the default show page of the portlet but it generates 500 Internal server error for the other simple jsp page I added, which suggests that the server is unable to find the function:
500 Internal Server Error
java.lang.NullPointerException
     at oracle.portal.provider.v2.url.UrlUtils.constructResourceURL(Unknown Source)
     at _htdocs._elogbooksubsystems._DAQ._jspService(_DAQ.java:54)
     [SRC:/htdocs/elogbooksubsystems/DAQ.jsp:15]
     at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
     at java.lang.Thread.run(Thread.java:534)
Can anybody help? Is this possible to use oracle api in the pages which are though added to the portlet but not the standard show modes pages?
Thanking you in anticipation
Regards,
Omer Alvi
Message was edited by:
user574208
Message was edited by:
user574208

Thanks Nrintala. I tried to work with multipage portlet example provided in the jpdk. In fact I created another portlet with two pages and copied the code of the two pages of the multipage portlet. (Off course I took care of the names and stuff). Later I modified the provider.xml by defining "next_page" parameter. When I viewed my portlet, first page appeared fine but when I click on the link which should show the second page, I got an error which says.
Error:      Error occurred while rendering portlet - see provider log file for details.
Do you think I have missed something? I am depoying my war file on the stand alone OC4J and some how I have not been able to find the application.log file in my application inside the application_deployments of the J2EE_HOME. I have pasted the provider.xml file and I would be grateful if you can help.
<?xml version = '1.0' encoding = 'UTF-8'?>
<?providerDefinition version="3.1"?>
<provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
<session>false</session>
<passAllUrlParams>true</passAllUrlParams>
<portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
<id>1</id>
<name>mulitpage</name>
<title>testing multi page</title>
<description>My Portlet Description</description>
<timeout>40</timeout>
<showEditToPublic>false</showEditToPublic>
<hasAbout>false</hasAbout>
<showEdit>false</showEdit>
<hasHelp>false</hasHelp>
<showEditDefault>false</showEditDefault>
<showDetails>false</showDetails>
<renderer class="oracle.portal.provider.v2.render.RenderManager">
<contentType>text/html</contentType>
<showPage>/htdocs/mulitpage/first.jsp</showPage>
<pageParameterName>next_page</pageParameterName>
</renderer>
</portlet>
</provider>
Best regards,
Omer
Message was edited by:
user574208
Message was edited by:
user574208

Similar Messages

  • How to run the simple jsp on oracle 9ias application server?

    hi,
    how to run the simple jsp application jst disply the date on oracle 9ias application server?
    can any expline the steps how to do it?
    thanks
    pullareddy

    No, you need the Reports Server (as part of the Application Server or Weblogic, depending on your version).
    I try to save the report, it's saved as .jspThat depends. You can save it as a .rdf file too (so called Paper Layout). I think this option is used more often.

  • Unable to get the AppsLocalLogin.jsp page

    Hi,
    We are on oracle Db 11.2.0.2 and EBS : 11.5.10.2 on Solaris Sparc 64 Bit 5.10.
    We have recently added a web node to an existing setup.
    Although Apache services are up , but we are unable to get the AppsLocalLogin.jsp page.
    Replacing the domain name and Ip in line 4  with HOSTNAME.DOMAIN_NAME/IPADDRESS
    We have found the below error in the Jserv log :
    [12/04/2012 20:09:38:868 IST] <info> ApacheJServ/1.1.2 is starting...
    [12/04/2012 20:09:38:868 IST] <debug> using confFile /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties
    [12/04/2012 20:09:39:016 IST] <info> Connection authentication enabled
    [12/04/2012 20:09:39:045 IST] <info> Connection allowed from HOSTNAME.DOMAIN_NAME/IPADDRESS
    [12/04/2012 20:09:39:045 IST] <info> Connection allowed from /127.0.0.1
    [12/04/2012 20:09:39:046 IST] <debug> port 16000 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16001 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16002 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16003 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16004 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16005 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16006 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16007 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16008 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> port 16009 is specified in properties file
    [12/04/2012 20:09:39:046 IST] <debug> try to start on port 16000
    [12/04/2012 20:09:39:050 IST] <debug> try to start on port 16001
    [12/04/2012 20:09:39:050 IST] <debug> cannot create socket on 16000
    [12/04/2012 20:09:39:051 IST] <debug> cannot create socket on 16001
    [12/04/2012 20:09:39:051 IST] <debug> try to start on port 16002
    [12/04/2012 20:09:39:051 IST] <debug> cannot create socket on 16002
    [12/04/2012 20:09:39:051 IST] <debug> try to start on port 16003
    [12/04/2012 20:09:39:051 IST] <debug> cannot create socket on 16003
    [12/04/2012 20:09:39:051 IST] <debug> try to start on port 16004
    [12/04/2012 20:09:39:051 IST] <debug> cannot create socket on 16004
    [12/04/2012 20:09:39:051 IST] <debug> try to start on port 16005
    [12/04/2012 20:09:39:052 IST] <debug> cannot create socket on 16005
    [12/04/2012 20:09:39:052 IST] <debug> try to start on port 16006
    [12/04/2012 20:09:39:052 IST] <debug> cannot create socket on 16006
    [12/04/2012 20:09:39:052 IST] <debug> try to start on port 16007
    [12/04/2012 20:09:39:052 IST] <debug> cannot create socket on 16007
    [12/04/2012 20:09:39:052 IST] <debug> try to start on port 16008
    [12/04/2012 20:09:39:052 IST] <debug> cannot create socket on 16008
    [12/04/2012 20:09:39:052 IST] <debug> try to start on port 16009
    [12/04/2012 20:09:39:052 IST] <debug> cannot create socket on 16009
    ApacheJServ/1.1.2: Failed to bind to port(s) specified in /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties.  Please check /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties and jserv.conf file, and make sure number of JServ process specified in jserv.conf is less than number of ports specified in /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties. and the ports are not used by other processes.
    [12/04/2012 20:09:39:053 IST] <critical> ApacheJServ/1.1.2: Failed to bind to port(s) specified in /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties.  Please check /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties and jserv.conf file, and make sure number of JServ process specified in jserv.conf is less than number of ports specified in /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties. and the ports are not used by other processes.The IP of this web node is different from the IP mentioned in the log, at line 4.
    Regards
    KK

    Hi;
    ApacheJServ/1.1.2: Failed to bind to port(s) specified in /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties. Please check /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties and jserv.conf file, and make sure number of JServ process specified in jserv.conf is less than number of ports specified in /pch3/oracle/external/prdora/iAS/Apache/Jserv/etc/jserv.properties. and the ports are not used by other processes.Please check your port is avaliable or not also check related path
    Regard
    Helios

  • How run the simple .jsp file on 9 i as application server?

    hi,
    i developed simple .jsp file on notepad,the same .jsp file to run in 9ias server?
    how can any one help me or send steps how to do?
    jpullareddy

    Hi,
    Try out these samples...
    http://otn.oracle.com/sample_code/tech/java/jsp/htdocs/jspdemo/OjspReadme.html
    Thanks,
    Rajat

  • How can i hand the RowSet to the next jsp page

    In a jsp page, I get a RowSet as the following:
    <input type="hidden" name="result" value="<%=ds.getRowSet()%>">
    I want to handle with this RowSet in the next jsp page, so
    I do in the next jsp page as the following:
    <% RowSet rowset = (RowSet)request.getAttribute("result"); %>
    But I was told null error. How can i hand the RowSet to the next jsp page.Help. Thanks a lot!

    Hello Charles,
    I did the registration in the same way as in the JDeveloper 3.2.3 (see follows)
    // make sure the application is registered
    oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "ReefBC_BCPackage_BCPackageModule");
    The argument ReefBC_BCPackage_BCPackageModule is a property file (ReefBC_BCPackage_BCPackageModule.properties). After some tries, I can still use it in JDeveloper 9i R2. The reason to keep it is that there would be a lot of migration work of javabean calling if I change it to <job:DataWebBean..>. But I am wondering, do I initialize two application modules when I use registerApplicationFromPropertyFile() and <jbo:ApplicationModule..> in the same page.
    The problem in doStartTag() is found after I post "http://forums.oracle.com/forums/thread.jsp?forum=83&thread=155210&tstart=75&trange=15", by tracing into the <jbo:ApplicationModule..> after calling the OrdHttpUploadFormData. HtmlServices.getRequestParameters sends back an exception, that breaks the running of the program. It was temperorily solved by extending the ApplicationModuleTag. If <jbo:..> could use the application module initialized by registerApplicationFromPropertyFile(), I guess it may be a better workaround.
    Long postings are being truncated to ~1 kB at this time.

  • I can no longer  add a scanned document to a pages document since the recent update , how to fix ?

    I can no longer add a scanned document to a pages document since the recent pages upsoftware update . Any ideas on how to resolve this ?

    What is the format of the document(s)?
    What exaclty happens when you try?\
    Have you tried the Numbers forum?
    https://discussions.apple.com/community/iwork/pages

  • Struts can't display the input jsp page

    Hello,
    I'm using Struts 1.3.8 to construct a simple user registration system, in which the user could input his info (such as uuname and gpin, both are strings) in a jsp page, and after the submit, the system should go to a success page. However, somehow, when I access the url, it goes directly to the success page, but not stay at the input page.
    Here is my {color:#ff0000}struts-xml.config{color}
    bq. <?xml version="1.0" encoding="UTF-8"?> \\ <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> \\ <struts-config> \\ <form-beans> \\ <form-bean name="{color:#ff0000}anotherUserForm{color}" type="com.visualbuilder.struts.beans.AnotherUser" /> \\ </form-beans> \\ <!-- Global Exceptions --> \\ <global-exceptions></global-exceptions> \\ <!-- Global Forwards --> \\ <global-forwards> \\ <forward name="success" path="success.jsp"/>     </global-forwards> \\ <!-- Action Mappings --> \\ <action-mappings> \\ <action path="/{color:#ff0000}addanotheruser{color}" type="com.visualbuilder.struts.action.AddAnotherUserAction" name="{color:#ff0000}anotherUserForm{color}" attribute="user" input="{color:#ff0000}/addanotheruser.jsp{color}" cancellable="true"> \\ </action> \\ </action-mappings> \\ <!-- Message Resources --> \\ <message-resources \\ parameter="registration.resources.ApplicationResources" /> \\ </struts-config>
    My action class is:
    package com.visualbuilder.struts.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.visualbuilder.struts.beans.AnotherUser;
    public class AddAnotherUserAction extends Action {
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (isCancelled(request)) {
    return mapping.findForward("welcome");
    {color:#ff0000}AnotherUser anotherUser = (AnotherUser) form;{color}
    System.out.println("UUName: " + anotherUser.getUuname() + "\tGPIN: " + anotherUser.getGpin());
    {color:#ff0000}return mapping.findForward("success");{color}
    My ActionForm class is:
    package com.visualbuilder.struts.beans;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class AnotherUser extends ActionForm {
    private static final long serialVersionUID = 1058901817587421984L;
    private String uuname;
    private String gpin;
    public String getGpin() {
    return gpin;
    public void setGpin(String gpin) {
    this.gpin = gpin;
    public String getUuname() {
    return uuname;
    public void setUuname(String uuname) {
    this.uuname = uuname;
    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    uuname = null;
    gpin = null;
    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    return errors;
    The input jsp page is addanotheruser.jsp:
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Another User Registration</title>
    </head>
    <body>
    <h1>Another User Registration</h1>
    <html:errors />
    <table>
    {color:#ff0000}<html:form action="addanotheruser">{color}
    <tr>
    <td>UUName</td>
    <td>{color:#ff0000}<html:text property="uuname"></html:text>{color}*</td>
    </tr>
    <tr>
    <td>GPIN</td>
    <td>{color:#ff0000}<html:text property="gpin"></html:text>{color}*</td>
    </tr>
    <tr>
    <td><html:submit/></td>
    <td><html:cancel/></td>
    </tr>
    </html:form>
    </table>
    </body>
    </html>
    Everytime I access http://localhost:9080/addanotheruser.do, it jumps to the success.jsp, but not stay at addanotheruser.jsp to wait for the user input, and in the server's console, I could see the output "UUName: null GPIN: null"
    I've been stuck at this simple program for three days, could anybody help to find the errors? Thanks a lot.

    sorry, the post looks ugly. Does anybody know how to make the indent not disappear?

  • Hide and Display submit button on the Simple search page.

    Heading 1: h1 Hide and Display submit button on the Simple search page.
    I'm trying to set the enabled property of the submit button on the simple search page. The business case is to disable the button if the VO has not returned any rows.
    The Submit button is on the page button bar.
    regards
    Abhi

    Hi,
    I have already added this in my ProcessRequest, the issue I am facing is it the submit button is disabled while I load >the page which is fine. but when I do a search and the query returns rows still the submit button is disabled.---Will nt reuired SPEL here..
    ---On go button click setsession value.
    Follow below steps:
    CO PR:*
    OASubmitButtonBean continueBtn=(OASubmitButtonBean)flowLayout.findChildRecursive("continueBtn");
    if(continueBtn != null && "D".equals(oapagecontext.getSessionValue("Flag"))
    continueBtn.setDisabled(false);
    else if(continueBtn != null )
    continueBtn.setDisabled(true);
    CO PFR:_
    if(pageContext.getParameter("Go") != null)
    oapagecontext.putSessionValue("Flag","D");
    Regards
    Meher Irk
    Edited by: Meher Irk on Mar 22, 2011 7:48 PM
    Edited by: Meher Irk on Mar 22, 2011 7:48 PM

  • How can you opening the tree.jsp page to a specific folder?

    I am trying to pass a query string into the viewer.jsp page so that I can open the appropriate folder relating to that query string. I can't find a way to do this as of yet. A lot of the code doing the work is only .class files so it is challenging.
    If you have any ideas as to how to begin to tackle this problem please let me know. Basically the querystring would contain the folder I want the tree to open to.
    Thanks,
    Simon

    See:
    *https://mike.kaply.com/2012/02/09/integrating-add-ons-into-firefox/

  • Error while trying to open the same JSP page.

    Hi partners,
    After solving some issues with JSP deployment, we are getting another error message.
    This is when we try to open the same JSP page at the same time.
    500 Internal Server Error
    javax.servlet.jsp.JspException: oracle.express.idl.util.OlapiException: ORA-22275: invalid LOB locator specified at oracle.dss.addins.jspTags.PresentationTag.doStartTag(PresentationTag.java:194) at Principal.jspService(_Principal.java:68) [SRC:/Principal.jsp:6] at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java(Compiled Code)) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:513)
    I mean this is a concurrency problem.
    Any information about this will be really appreciated.
    Best regards!!!!!
    Francisco Mtz.

    After running the BI_Checkconfig tool I got an inconsistent OLAP API Metadata
    result, it was because a partner was modifying the OLAP metadata without saving
    the changes.
    After saving the changes in the OLAP metadata, I ran the BI_Checkconfig tool
    again with success (no metadata errors).
    Now the pages are displayed without any error message.
    Best regards!!!!
    Francisco Mtz.

  • How do I expand my simple JSP page to implement Connection Pooling?

    Hi everyone,
    I have a small SQL database which contains information about Students and a StudenBean which contains their attributes and appropriate get/set methods (which I haven't needed to use yet).
    I want to write a simple JSP page which displays all the students details in one big table. I can do this using the basic prototyping method of adding the dataSource and driver details to the deployment descriptor (web.xml - I'm using the latest version of Tomcat by the way) and then accessing the database using JSP standard SQL actions.
    Here's a snipet of what I've done (just an example, the final code works):
    <sql:query var="temp"
    sql="SELECT * FROM Employee ORDER BY UserName"
    />
    <c:forEach items="${temp.rows}" var="row">
    <td><c:out value ="${row.UserName}"/></td>
    <td><c:out value ="${row.FirstName}"/></td>
    <td><c:out value ="${row.LastName}"/></td>
    Now I want to upgrade! I want to access the dataSource using Connection Pooling and it's causing me a lot of trouble. I already have the required working classes/data such as ConnectionPool.java, ResourceManagerListener.java, the MySQL driver etc.
    However, I don't know what the best way to setup the connection for my purposes would be and where I should do it.
    Do I need to write a servlet or tag handler/custom action to establish the connection and access my bean through it? I would like to keep a similar sort of business logic as I already have developed i.e. be able to use actions in my JSP page to cycle through the database and print out each detail from the row.
    Rather confused and muddled. Thanks for any input!

    Good idea.
    Set up a JNDI data source for your app, according to these docs:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    You'll have to put the right information into your web.xml and a context.xml. Once you've done that, your JSTL JSPs will simply use the connection resource automagically.
    MOD

  • The edit JSP page does not appear...

    Hi!
    I make a simple JSF application, I would like to show a DB table in a h:dataTable component and edit a given row after click, but the edit JSP page does not appear. I click the on link in the table, but the list is loaded again and not the edit page...:(
    (no exception in application server console)
    Please help me!
    my code:
    **************************************** listmydata.jsp***************************
                   <h:dataTable
                             value="#{myBean.myDataList}"
                             var="myDataItem"
                             binding="#{myBean.myDataTable}"
                   >
                        <h:column>
                             <f:facet name="header">
                                  <h:outputText value="Ajdi"/>
                             </f:facet>
                             <h:commandLink action="#{myBean.editMyData}">
                                  <h:outputText value="#{myDataItem.id}"/>
                             </h:commandLink>
                        </h:column>
    ********************************* MyBean.java *******************************
    package bean;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.component.html.HtmlDataTable;
    import javax.faces.context.FacesContext;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    import wrapper.MyData;
    public class MyBean {
         private List myDataList;
         private HtmlDataTable myDataTable;
         private MyData myDataItem;
         protected Connection Conn;
         // *********************** actions ***********************
         public String editMyData() {
              myDataItem = (MyData)getMyDataTable().getRowData();
              return "editmydata";
         public String saveMyData() {
              try {
                   updateDataInDB();
              catch (SQLException e) {
                   System.out.println(e);
                   System.err.println(e);
                   e.printStackTrace();
              catch (NamingException e) {
                   System.out.println(e);
                   System.err.println(e);
                   e.printStackTrace();
              return "listmydata";
         // *********************** setter ***********************
         public void setMyDataList(List myDataList) {
              this.myDataList = myDataList;
         public void setMyDataTable(HtmlDataTable myDataTable) {
              this.myDataTable = myDataTable;
         public void setMyDataItem(MyData myDataItem) {
              this.myDataItem = myDataItem;
         // *********************** getter ***********************
         public List getMyDataList() {
              if (myDataList == null || FacesContext.getCurrentInstance().getRenderResponse()) {
                   loadMyDataList();
              return myDataList;
         public HtmlDataTable getMyDataTable() {
              return myDataTable;
         public MyData getMyDataItem() {
              return myDataItem;
         // *********************** others ***********************
         public void loadMyDataList() {
              try {
                   getDataFromDB();
              catch (NamingException e) {
                   System.out.println(e);
                   System.err.println(e);
                   e.printStackTrace();
              catch (SQLException e) {
                   System.out.println(e);
                   System.err.println(e);
                   e.printStackTrace();
         void getDataFromDB() throws NamingException, SQLException {
              myDataList = new ArrayList();
              java.sql.PreparedStatement PreStat = ownGetConnection().prepareStatement("SELECT id, name, value FROM BEA_JSF_SAMPLE");
              PreStat.execute();
              java.sql.ResultSet Rs = PreStat.getResultSet();
              while(Rs.next()) {
                   MyData OneRecord = new MyData();
                   OneRecord.setId(Rs.getLong(1));
                   OneRecord.setName(Rs.getString(2));
                   OneRecord.setValue(Rs.getString(3));
                   myDataList.add(OneRecord);
         void updateDataInDB() throws SQLException, NamingException {
              String sql = new String("UPDATE BEA_JSF_SAMPLE SET name=?,value=? WHERE id=?");
              java.sql.PreparedStatement PreStat = ownGetConnection().prepareStatement(sql);
              PreStat.setString(1,myDataItem.getName());
              PreStat.setString(2,myDataItem.getValue());
              PreStat.setLong(3,myDataItem.getId().longValue());
              PreStat.execute();
              ownGetConnection().commit();
         Connection ownGetConnection() throws SQLException, NamingException {
              if (Conn == null) {
                   InitialContext IniCtx = new InitialContext();
                   DataSource Ds = (DataSource)IniCtx.lookup("JDBCConnectToLocalhost_CRS");
                   Conn = Ds.getConnection();
              return Conn;
    ******************************* editmydata.jsp *****************************
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <html>
    <body>
    <f:view>
    <h:form>
         <h:panelGrid columns="2">
              <h:outputText value="Name"/>
              <h:inputText id="name" value="#{myBean.myDataItem.name}"/>
              <h:outputText value="Value"/>
              <h:inputText id="value" value="#{myBean.myDataItem.value}"/>
         </h:panelGrid>
         <h:commandButton action="#{myBean.saveMyData}" value="Save"/>
    </h:form>
    </f:view>
    </body>
    </html>

    I have put his lines in the faces-config.xml and now it works:
         <navigation-rule>
              <from-view-id>*</from-view-id>
              <navigation-case>
                   <from-outcome>editmydata</from-outcome>
                   <to-view-id>editmydata.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>*</from-view-id>
              <navigation-case>
                   <from-outcome>listmydata</from-outcome>
                   <to-view-id>listmydata.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    I don't understand, that I define the next JSP page in the bean java file, which must be shown, but I must define this in the faces-config.xml as well.
    for example:
         public String editMyData() {
              myDataItem = (MyData)getMyDataTable().getRowData();
              return "editmydata";
    is it right or Do I make a mistake somewhere?

  • Updated to 7.0.6 on my iPhone 5s and now my phone is all out of whack. It won't sync the new playlists I added after the update though when it's plugged into iTunes it says it's synced. Help please!

    So I updated my iPhone 5s to version 7.0.6 yesterday, and now my iPhone music isn't working properly. It won't sync the playlists that I added after the update though when it's plugged in on iTunes it says that the music is synced. When I select a song in a playlist on the phone it shuffles through the playlists for like 3 seconds and picks a totally different song to play. I tried reinstalling iTunes, I tried restoring the iPhone, is it just a bug with the update? Nothing works. Any solutions are welcome.

    DFU mode? How do I do that? So far the only thing I can do is hold down both buttons to power it on and nothing is on the screen and it wont reconize on my computer....

  • Issue with the new COPA field added into the BBSEG Structure

    Hello All,
    I have an issue with the new COPA field added into the BBSEG Structure.
    I think its added becuase of test Operationa Conern Created by somebody.
    Can you please let me know how to remove that structure from BBSEG Structure.
    Thanks
    vsr

    Hi Monohar & Ankur,
      Thanks for your answers..
      main issue is suddenly new field called RKE_COPA_KOSTL has  been added to the BBESG Structure..
      Because of this RFBIBL00 Upload is not working. I heard that  this new fields will come by generating Operating Concerns by Transaction KEA0.I found an operating concern which was created as a test in developemt system..
      But I am not sure how to delete that operating concern.Even i am not sure if we delete the Operating Concern ..is it going to delete that field in BBESG Structure or not??
    Please advise me..
    Thanks
    sathi

  • How to get the filename of the active jsp page?

    how can i get the filename of the active jsp page?

    You could register the JSP [ages in the web.xml and then use the ServletConfig.getServletName.
    You could use the JspContex.getServletName which will return the registered name or the name of the servlet class.
    You could programmatically add a page context attribute that holds the jsp page name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Is there a way to create a shared net conn. between Airport and Ethenet?

    Is there a way to create a shared internet connection between one airport computer and another via ethernet? I have one computer (lets call this computer 'A') connected to the net via Airport which connects to a router, which is directly connected to

  • Billing due list problem with customized document types

    Dear Team, We have created a new Rental contract and Rental Invoice document types by copying the standard ones (MV & FV), while trying to get the Billing due list, unable to get the Rental Invoice type, rather the system is proposing the standard In

  • Error while loading the Web template "0ANALYSIS_PATTERN" (return value "4")

    I activated all 0* objects in BTMP  and checked that they are all activated, but I found errors when opening the BEx Web Analyzer Error messages : Error while loading the Web template "0ANALYSIS_PATTERN" (return value "4") ERROR: Command type SWITCH_

  • Sub totals display

    hai friends iam useing alv grid display to dispaly the report in that report i have LIFNR,BUKRS,BUDAT,DMBTR ,      SHKZG,WAERS  from BSIK table the problem is SHIKZG field we have values like S and H. so particular LIFNR may have both S and H values

  • CJE0 - Transaction Code

    Dear Friends I created a T code for CJE0 report. ( with client program names) It works by my problems are. 1.when i run through CJE0 directly output comes with only summary details but when i run with Tcode output comes with detail breakdown, i want