Checking Form Modes in a single jsp page

Hi
I am developing a web application using ADF BC, struts and JSP technologies.
I use JDeveloper 10.1.3. I need to check the mode which my form goes through; for example, if I am in the create mode, I can disable Delete and Find buttons
and etc..Is there any code or property that would let me check the Foem Modes and act correspondingly??
Message was edited by:
Tami

the only way would be to change the header and navigation includes that you have, so that they generate a correct html page when included.
I would probably remove the head tag from the navigation stuff.
Although javascript functions SHOULD be declared in the head tags, they normally do work elsewhere on the page.
The page will probably still take a long time to load, even if you get the page formatted correctly - I would look more at the javascript functions running which would slow down the page.

Similar Messages

  • HTML multipart form is not working in jsp page

    Hi
    i have jsp page, has a HTML from with file upload field , when i click the send button , nothing happened as if the button did not submit the form. ie the message at line 12 is not printed out.
    can any one help please.
    <%@ page errorPage="..\error\error.jsp" %>
    <%@ page pageEncoding="windows-1256" %>
    <%@ page language="java" import="javazoom.upload.*,java.util.*,java.sql.ResultSet" %>
    <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
      <jsp:setProperty name="upBean" property="folderstore" value="<%=request.getRealPath("thuraya//uploads")%>"  />
    </jsp:useBean>
    <jsp:useBean id="dbc" class="mypackage.DBConnection" scope="session" />
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.println("addbtn");
            //do upload file + insert in database
             if (MultipartFormDataRequest.isMultipartFormData(request))
             // Uses MultipartFormDataRequest to parse the HTTP request.
             MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
             String todo = null;
             if (mrequest != null) todo = mrequest.getParameter("todo");
                 if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
                    Hashtable files = mrequest.getFiles();
                    if ( (files != null) && (!files.isEmpty()) )
                        UploadFile file = (UploadFile) files.get("filename");
                        if (file != null)
                                            out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
                                            String fileName=file.getFileName();
                                            String ran=System.currentTimeMillis()+"";
                                            String ext=fileName.substring(   ( fileName.length()-4),fileName.length() );
                                            file.setFileName(ran+ext);
                        // Uses the bean now to store specified by jsp:setProperty at the top.
                        upBean.store(mrequest, "filename");
                                            String title=request.getParameter("title");
                                            String content=request.getParameter("elm1");
                                            int x=dbc.addNews(title,content,file.getFileName(),2,1);
                                            if(x==1)
                                                     out.print("New Vedio has been addedd Successfully");
                                                      response.setHeader("Refresh","1;URL=uploadVedio.jsp");
                                                     else{
                                                      out.print("An Error Occured while adding new Vedio");
                                                      response.setHeader("Refresh","1;URL=uploadVedio.jsp");
                    else
                      out.println("<li>No uploaded files");
             else out.println("<BR> todo="+todo);
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input onClick="submit()" name="addBTN" type="button" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

    the problem is not because of java code insdie jsp page
    I have removed all things but the form and it is still not working
    here is the modified code:
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.print("addBTN");
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input name="addBTN" type="submit" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

  • Form Authenticating the portal or jsp page

    Before accessing a jsp page, I want the user to authenticate using login.jsp using the user role I created in console.
    But when I hit the page, its not going to login.jsp. Instead its going directly to it. Please find the web.xml and weblogic.xml that I changed below,
    --web.xml
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>webtest</web-resource-name>
    <url-pattern>/portlets/tools/wnxinterface/wnxInterface.jsp</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>wnuser</role-name>
    </auth-constraint>
    <user-data-constraint>
    <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    <!--turn on identity assertion-->
    <login-config>
    <auth-method>CLIENT-CERT,FORM</auth-method>
              <realm-name>myrealm</realm-name>
    <form-login-config>
    <form-login-page>login.jsp</form-login-page>
    <form-error-page>error.jsp</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
              <role-name>AuthenticatedUserRole</role-name>
    </security-role>
    <security-role>
              <role-name>wnuser</role-name>
    </security-role>
    --weblogic.xml
    <wls:security-role-assignment>
    <wls:role-name>AuthenticatedUserRole</wls:role-name>
    <wls:principal-name>AuthenticatedUsers</wls:principal-name>
    </wls:security-role-assignment>
    <wls:security-role-assignment>
         <wls:role-name>wnuser</wls:role-name>
         <wls:principal-name>wngroup</wls:principal-name>
    </wls:security-role-assignment>
    I created the wnuser in myrealm in my console. So I am trying to password protect the wnxInterface.jsp page.
    Actually I have this wnxInterface.jsp as a portlet inside my portal. Is it similarly possible to authenticate the portal itself?
    Thanks in advance

    1. yes: URL u = new URL(this.getCodeBase(),"../relativeFolder/file.whatever");
    http://javaalmanac.com/cgi-bin/search/find.pl?words=URL
    2. yes: using JSObject you can call javaScript methods that can do it for you or retreive the
    componenet directly.
    http://forum.java.sun.com/thread.jspa?threadID=598123&messageID=3180053

  • How to use single JSP page for multiple users.

    Hi ,
    I am doing messenger kind of program using JSP and tomcat server.
    When i type message it is showing in the some div. If some other person request for the same page by giving my IP address and jsp page, he should able to see what i have typed on page so far.
    how can i do that one . can any one guide me .
    Thanks in advance.

    SuneelGoodatJava wrote:
    Hi ,
    I am doing messenger kind of program using JSP and tomcat server.
    When i type message it is showing in the some div. If some other person request for the same page by giving my IP address and jsp page, he should able to see what i have typed on page so far.
    how can i do that one . can any one guide me .
    Thanks in advance.HTTP is a request/response protocol. You can't do what you're suggesting without "pushing" what you type to all the other users. That's not the way HTTP works. Maybe an applet and servlet.
    %

  • Removing an Application Module form the Pool in a JSP Page

    I am getting the following error:
    JBO-30003: The application pool (dpi.src.business.srcSchReportAppModule.srcSchReportAppModuleLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.DMLException: JBO-26066: Error during rollback.
         at oracle.jbo.server.DefaultTxnHandlerImpl.handleRollback(DefaultTxnHandlerImpl.java:153)
         at oracle.jbo.server.DBTransactionImpl.doRollback(DBTransactionImpl.java:3657)
         at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:1826)
         at oracle.jbo.server.ApplicationModuleImpl.resetState(ApplicationModuleImpl.java:3156)
         at oracle.jbo.server.ApplicationModuleImpl.resetState(ApplicationModuleImpl.java:3145)
         at dpi.src.business.srcSchReportAppModuleImpl.resetState(srcSchReportAppModuleImpl.java:44)
         at oracle.jbo.server.DBTransactionImpl.disconnect(DBTransactionImpl.java:3971)
         at oracle.jbo.server.DBTransactionImpl2.disconnect(DBTransactionImpl2.java:306)
         at oracle.jbo.server.DBTransactionImpl.disconnect(DBTransactionImpl.java:4108)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.disconnect(DefaultConnectionStrategy.java:328)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.disconnect(ApplicationPoolImpl.java:2979)
         at oracle.jbo.common.ampoo[i]Long postings are being truncated to ~1 kB at this time.

    Hi,
    e. I executed the following test script to simulate "heavy" load without exception against 9.0.3 (assumes DB has been configured to support 300 sessions). What is different?
       public static void main(String[] args)
          Mypackage1ModuleImpl impl = new Mypackage1ModuleImpl();
          try
             impl.doTest();
          catch (InterruptedException e)
             e.printStackTrace();
       public void doTest() throws InterruptedException
          int numOfThreads = 300;
          BlockingThread[] threads = new BlockingThread[numOfThreads];
          for (int i=0; i < threads.length; i++)
             SessionCookie cookie = pool.createSessionCookie(String.valueOf(i), String.valueOf(i), null);
             threads[i] = new BlockingThread(cookie);
             threads.start();
    for (int i=0; i < threads.length; i++)
    threads[i].join();
    PrintWriter pw = new PrintWriter(System.out, true);
    pool.dumpPoolStatistics(pw);
    class BlockingThread extends Thread
    private boolean mBlocked = false;
    private boolean mIsWaiting = false;
    private final SessionCookie mSessionCookie;
    [i]Long postings are being truncated to ~1 kB at this time.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get the form reference in .js page from .jsp page

    hi
    i have written one form in jsp page omething like:-
    <html:form action="/shopping" onsubmit="return false;">
    can anybody tell me,how to get the form reference in .js page from .jsp page ,
    i have tried:-
    var formRef = document.forms[0];
    butits not working.
    Thanks.

    Its very simple......y cant u prefer google...Bad
    c this example...
    function submit()
    alert("textbox"+ document.forms[0].name.value);//to get textbox value in js
    document.forms[0].submit();//to submit jsp page using js
    <html:html>
    <html:form action="/shopping" onsubmit="submit()">
    <html:text property=name>
    learn to search in google..
    </html:form>
    </html:html>

  • To combine a multiple jsp pages in a one single page

    hi all,
    my problem statement is, i have 5 tabbed panes i,e each in a jsp page i need to put all those information into one single jsp page...while submiting the data. so how can i do about this using jsp.
    regards
    geetha

    The use of frames is highly discouraged (as is the use of scriptlets). So don't even think about it.
    You can just include a JSP page in each tab using jsp:include. You can hide/show the tabs using CSS/JS and/or a request parameter.

  • How I can open a jsp page in readonly mode

    Hi, I have a problem in JSP. I want to open a jsp page in read only mode. How I can do this?

    Can you explain what you mean by "open a jsp page in read only mode"? open the jsp file in an editor in read only mode? load the jsp page only once all by the server? tell web client that the response will never change?

  • How can i execute some code in a jsp page on the same page ? plz read.

    I have made a single JSP Page where in i want to delete users, create users, update table data.
    I have all the UI on the first page. Now i want to write my all JDBC coding on just this single page. I don't want to create 3 separate pages. Can it be done ?

    This is my page !!
    I have 3 separate pages insert.jsp, delete.jsp, update.jsp to implement the jdbc coding. I know that i can get it done by calling a single jsp page using URL rewriting. But i want to code for events on this very page only.
    <%@page language="java"%>
    <%@page import="java.sql.*"%>
    <HTML>
         <BODY>
              <form method=post action="insert.jsp">
                   Username:<input type=text name=username><br>
                   Password:<input type=password name=password><br>
                   <input type=submit>               
              </form>
              <hr>
              <form method=post action="delete.jsp">
                   Username:<input type=text name=username><br>
                   <input type=submit>               
              </form>
              <hr>
              <form method=post action="update.jsp">
                   Username:<input type=text name=username><br>
                   Password:<input type=password name=password><br>
                   <input type=submit>               
              </form>          
         </BODY>
    </HTML>

  • Removing scrollbars on the JSP page of frames created by included JSP files

    Hi All,
             In the iternet sales B2B application which we are developing, has a blank JSP file. Wherein we are adding other JSP files on it, loading trough JS.
    When we are adding it is making the various jsp files in the form of the frames, and each frame has different JSP page. So it is adding scrollbars on each frame if the size of the page exceeds the size of frame.
    we don't want the scrollbars. Kindly suggest to remove these scrollbars, and all the pages should look as a single JSP page.
    Thanks & Regards
    EKta

    Hi
    set scrolling="no" while creating frames
    Murali.K.N

  • Automatic reflection of changes in JSP pages in R12i

    As per note metalink note 458338.1, i have set the main_mode from justrun to recompile in context file and run autoconfig.
    Also confirmed for the entry in $INST_TOP /ora/10.1.3/j2ee/oacore/application-deployments/oacore/html/orion-web.xml file.
    Still i am finding that the _.class files are not being updated in $COMMON_TOP/_pages
    The problem is if i add/end data any responsibility for any user, the change reflects in the forms, but not in the JSP pages when the user logs in next time. I have also verified the change in the back end.
    Also there are users using iRecruitment JSP pages. Any changes they make is not reflecting. Every time i have to bounce the Apache for the change to reflect.
    Any one has any clues on how to resolve this issue?

    I just ran those two conucrrent programs and retried.
    But still there is no resolution. I added and end dated few responsibilities. how ever they are not reflecting in the JSP page after login.
    Also no _.class files show the latest timestamp in $COMMON_TOP/_pages location.

  • How to add multiple bean id in a jsp page

    i need to add two bean id in a single jsp page can anyone suggest me how can i do that?
    <jsp:useBeanid="newmember" class = "com.assignment.member" scope ="request"/>now if i want to add another bean id in the same jsp page is that possible? how can i do that? please help

    <jsp:useBeanid="newmember" class = "com.assignment.member" scope ="request"/>
    <jsp:useBeanid="newmember2" class = "com.assignment.member2" scope ="request"/>
    <jsp:useBeanid="newmember3" class = "com.assignment.membe3r" scope ="request"/>
    upto N bean

  • Including JavaScript into a JSP Page

    Hi,
    How do i include a piece of JavaScript <SCRIPT> stuff into a JSP Page?
    Right now i have an HTML Page that includes some <SCRIPT> code. Now many other HTML files use this piece of <SCRIPT> stuff. How do i remove it , put it in one place(I mean where to put it and what would that file be called) and in a JSP page call this <SCRIPT> code?
    Please help . i'm pretty new to JSP and JavaScript.
    Thanks in Advance.
    Phani
    /**** CODE
    <SCRIPT language=javascript>
    <!--
         if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') == -1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/1.css\">");
         else if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') > 1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/5.css\">");
         else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') == -1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/2.css\">");
         else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') > 1))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/3.css\">");
         else if (("Netscape" != navigator.appName) && ("Microsoft Internet Explorer" != navigator.appName))
         document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/6.css\">");
    // -->
    </SCRIPT>

    Ok, first let us make clear the demarcation between java and javascript.
    Java runs on the server, and produces an HTML page which is sent to the client.
    That HTML page may contain javascript code on it to run on the client side.
    As the page is loaded, javascript may be compiled/run on the client.
    So you have some javascript code which you want to include on every page as template text?
    I would do this in JSP by using the include directive to add that bit of template text to every single JSP page.
    ie
    header.jspf
    <SCRIPT language=javascript>
    <!--
    if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') == -1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/1.css\">");
    else if ((document.images) && ("Netscape" != navigator.appName) && (navigator.appVersion.indexOf('Mac') > 1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/5.css\">");
    else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') == -1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/2.css\">");
    else if (("Netscape" == navigator.appName) && (parseInt(navigator.appVersion) == 4) && (navigator.appVersion.indexOf('Mac') > 1))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/3.css\">");
    else if (("Netscape" != navigator.appName) && ("Microsoft Internet Explorer" != navigator.appName))
    document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"http://www.telia.se/tews/css/6.css\">");
    // -->
    </SCRIPT>
    <noscript>
      // stuff here for when the browser does not support javascript
    </noscript>And then in every jsp page
    <%@ page include="header.jspf" %>
    // rest of the JSP pageThe file "header.jspf" will be included with every jsp page served, and you only need to update that page in one place.
    If you have a JSP2.0 container you can define a jsp prelude which will be the same as having the <%@ page include="header.jspf" %> on every page.
    You do this in the web.xml file:
    Something like this:
      <jsp-property-group>
         <url-pattern>*.jsp</url-pattern>
         <include-prelude>/WEB-INF/jspf/prelude1.jspf</include-prelude>
      </jsp-property-group>The specified file will be loaded into every JSP page without the JSP page having to define the import itself.
    Hope this helps,
    evnafets

  • Carrying values across jsp pages

    hi there!
    i got a quick question...
    ive got a login page where users enter their email address and a password and upon pressing the submit button the login page calls the page processlogin.jsp which verifies this email addres and password with those values stored in the database.
    a successful login then displays another page where users submit other details. this form then calls another process jsp page which stores this new information in another table in the database.
    my question is how do i 'pass' through that initial email address the user enters on the login page through to this latter page....and inevitably...on to other pages too.
    the reason i need to do this is cos the table which i am storing these new details has email address as its foreign key and i need to store the same value.
    many thanks! :o)

    the simplest thing to do is create a bean to hold on to values a user enters and simply have access to them using the <%= bean.getEMAIL() %> or something like that. For multiple form pages, I like using <input type=hidden ...> to store values without having to create object to store them.
    But I think in your case, since you have a processing page for the form before it goes on then the bean is the best solution.
    Good luck

  • Forwarding JSP page through requestdispatcher problem in submiting form

    Hello everyone,
    I am very much new to servlet.
    My problem is somewhat this....
    when i am forwarding one JSP page by requestdispather , there is no problem.But after that when i am trying to submit one html form written inside the jsp page , the request is not submiting the jsp page rather it resides in the servlet.
    The code in servlet is
    RequestDispatcher rd =getServletContext().getRequestDispatcher("/applyConfirm.jsp");
    rd.forward(request,response);
    Now in (applyConfirm.jsp )jsp page one button is there , so when i will click that button the page has to be submitted.But its not submitting rather the request resides in the servlet.
    Dose someone will have any idea.
    Thanks in advance

    First check what sort of button you are using. It should be of "submit" type.
    Check the URL to witch URL it is submitting i.e. Action property in <FORM> tag.
    Make sure for the URLs in the client i.e HTML ex: href, action, and so on use the thumb rule of prefixing "<%=request.getContextPath()%>/" in your JSP or in servlet add it in the java code.
    This should solve the relative URL reference problem.
    Hope this helps.
    Cheers.

Maybe you are looking for

  • Can i use a gift card to buy an iPhone 6

    If I have a gift card from buying a computer, can I use it to buy an iPhone 6

  • Physical Query in OBIEE 10g vs OBIEE 11g

    Hi Everyone, We're in the middle of an OBIEE 10g to an OBIEE 11.1.1.6.4 upgrade and as part of our assembly testing we were planning on comparing the physical query generated for a report generated in obiee 10g vs the physical query for a report in o

  • Creative Zen Touch & Mac OSx comput

    Hi, I have been given a Apple Mac OSx powerbook laptop. I have downloaded my Creative Media Source onto my work computer (normal PC), but I tried to put the same disk into my laptop last night and it did not work. Is Creative compatable with Apple Ma

  • Best way to store historical data

    Hello: I'm currently developing an application that monitors some phisycal variables such as temperature and differential pressure in different locations. I also must do historical datalogging of the values read so the user can generate reports of th

  • TopLink 9.0.4 to 10.1.3.1 upgrade issue

    I've encountered a problem when upgrading our application from TopLink 9.0.4 to 10.1.3.1. I have a persistent class AccountPosition that contains an aggregate object instance of the class FundQuantity. FundQuantity is basically a wrapper for a java.m