Jsp struts url

Hi All,
I am using Java struts. We have several Struts-Jsps. when we browse from one jsp to another, the url is shown as below: All values are visible in the url
http://localhost:8080/PSS/pim/location.do?page=1&methodName=fetchAll&showSearchPage=true&beGeoId=52468
our requirement is we do not want the user to see the value of our parameters for e.g beGeoId=52468
Reason is user might change the value 52468 to say 52400 and may get different page. How can we avoid user from doing this. what technique we can use?
thanks,
pp

You could save the values in a browser cookie that your
JSP could read. This would allow you to avoid stringing
together a command for a JSP app. Have your JSP read
the browser cookie to get the values you need from the
client.
Within a JSP application that has multiple JSP pages, you
can use a JSP scope of session and store parms in a bean.
But, if you link to another JSP app, you'll have to string
together you command like your example or use a cookie.
Have Fun!!
John

Similar Messages

  • Frame issue in jsp/struts application

    I have a problem with jsp struts application .
    i have a jsp page which is inside a frame .
    The action class which receives the request from this page redirects the request to another jsp page.
    I want this new jsp page to be displayed without any frame , but it is getting displayed from inside the frame .
    can anybody help me out ...
    regards,               
    slam

    Possibly:
    1. Browser could be caching the page.
    2. If you use a proxy, the proxy may be caching the page.
    3. The page is not getting recompiled.

  • Non-ascii, jsp-struts, not reciveing the correct value in the server

    Hi,
    I am developing JSP-Struts based application using tomcat server. In JSP struts form, when I put nonascii charater in the text field or text area, on the server side I recived twice of that non-ascii character..
    for example, in the text field I entered following string:
    ------> This is text in tex field �ƒ
    On the server side, I get the following:
    ------> This is text in tex field �ƒ�ƒ
    Please notice, twice non ascii character.. :(
    I don't know how to resolve this.. Any help will be greatly appricated..
    Thanks,
    Ajay

    I changed the <form> in the jsp to div and its working fine. I do not need to have comments in JavaScript funcion() anymore. I don't know why that made the difference though? According to:
    http://www.w3schools.com/tags/tag_form.asp
    The <form> tag is used to create an HTML form for user input.
    The <form> element can contain one or more of the following form elements:
    <input>
    <textarea>
    <button>
    <select>
    <option>
    <optgroup>
    <fieldset>
    <label>
    An HTML form is used to pass data to a server.
    I do have <button> and also send the data - the value of checkboxes - to server. So I think it should also work with <form>.
    Please let me know if you have any idea. Thanks.

  • Tracking a separate Thread  - java/jsp/struts

    Hi all,
    My project is a webapplication using java/jsp/struts. My requirement is to write bulk data to a file, which i want to run as a separate thread. Since it runs as a separate thread the control comes back to UI (userInterface) page. On subsequent request from UI page by the user i want to check whether the thread process is completed or not , so that i can read from the file. Is it possible to simultaneously read from the file when the thread is in the process of writing data to the file. If so any idea on how to implement this functionality in java?
    How to keep track of the separate thread (whether it is completed or not) in java?
    Is it possible to read from the file when the thread is writing to the file in java?
    Thanks is advance.

    dangerous wrote:
    How to keep track of the separate thread (whether it is completed or not) in java?Thread#join().
    As you're already asking this trival question, I highly recommend you to read the Concurrency Tutorial here at Sun.com. Google can find it.
    Is it possible to read from the file when the thread is writing to the file in java?Not with java.io. You can use the java.nio API for that. You can also read/write it in memory (as a byte[] or a ByteArrayInputStream/OutputStream property) and if it is finished then write it to disk.

  • Deploy BC4J/JSP-Struts to IAS

    HI,
    I'm trying to deploy a BC4J/JSP-Struts application to IAS. This application was developed with JDeveloper 9.0.3.
    I can deploy this application to a Standalone OC4J (delivered with JDeveloper 9.0.3) on Windows2000 without problem.
    Then I want to deploy this application on Oracle9iAS 9.0.2. For this I create an .EAR file with JDeveloper and I start the OC4J Administrator tools from Oracle9iAS and deploy my application.
    I start the application with
    http://erbium.int.imd.ch:7778/InvoicesInterface/main.jsp?user=x-XxX
    and I become the menu without Problem.
    Then I click on the link
    http://erbium.int.imd.ch:7778/InvoicesInterface/VInvoiceUsersView1_Browse.do?user=x-XxX
    and I become following :
    HTTP 500 Internal server error
    The page cannot be displayed
    Did you have any Ideas ?
    Thanks Yves
    Configuration:
    - Oracle9iAS (9.0.2) on Solaris
    - JDeveloper9.0.3

    Yves -
    I am not able to pinpoint the exact error you are having but here are some obervations
    a) You are going backwards in versions of OC4J when you deploy to 9iAS 902. If you are using JDev 903, then it is running with a local version of OC4J 903. When you are deploying to 9iAS 902, it's a earlier release of OC4J, so there may be an issue there. There is a 9iAS 903 version available from OTN that would be better to use in this case.
    b) Is the struts framework packaged as part of the EAR file you are deploying? i'm not familiar with how BC4J and Struts apps are packaged from JDeveloper, but this is something to check on for sure. The local OC4J running inside of JDeveloper may have the Struts libs configured at the server level.
    c) You might want to try and change the show-friendly-error-messages (or something like that) property inside of IE (if you are using it) so that it will display the stack trace the server might be sending. this may be of help to further locate the source of the problem (ClassNotFoundException, etc.).
    -steve-

  • Learning JSP/Struts with JDeveloper

    Hi. We have an older version of Java on our Unix production web server (1.4.2_12-b03) and it'll be a year before we upgrade it and use JSF. In the meantime, I'm looking at learning Struts and JSP. Can you point me to a few tutorials specific to JDeveloper for JSP/Struts? Most of the tutorials now are for ADF/JSF -- which we can't use yet. Thanks.

    Just to clarify - JSF can run on OAS 10.1.2 (that supports J2EE 1.3 and uses JDK 1.4).
    See: http://download.oracle.com/docs/html/B25947_01/deployment_topics006.htm#CIHCGGDF
    So this shouldn't be a reason for you not to use JSF and JDeveloper 10.1.3.
    That said if you want to learn Struts try following the archive links on the various JDeveloper tutorials/demos pages to the demos from the 9.0.5/10.1.2 days.

  • How to putput a property of an object in session? (jsp/struts)

    Guys,
    I have an object (myGroup) that consist of 2 properties: groupName and groupTitle. The object is in a session called group_session.
    On my jsp page, I would like to output the property groupName on the text field associated with the groupName:
                   <html:text      property="name"
                                                   value=???????????????
                                  size="45"
                                  maxlength="60" />
                                  <html:errors property="name" />Q: how can I output the value of the groupName in the value section?
    thanks

    Hi
    you can try something like this....
    <input type="text" name="any" property="<bean:write
    name="myGroup" property="groupName "
    scope="session"/> " >
    This snippet is closer to JSP coding rather than struts. Leverage the capabilities of struts by setting the values in ActionServlet instead.
    <html:text property="name" size="45"  maxlength="60" />                    -Rohit
    By the way why did you add this tag
    <html:errors property="name" /> ??
    Message was edited by:
    RohitKumar

  • How to instantiate object in JSP/STRUTS page?

    I worked through the STRUTS tutorial (http://rzserv2.fhnon.de/~lg002556/struts/Doku.html) but I get errors when I try to instantiate an object of a class that is in my WEB-INF/classes directory:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 14 in the jsp file: /BookSerialize.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    D:\Programme\jakarta-tomcat-4.1.12\work\Standalone\localhost\strutsdemo\BookSerialize_jsp.java:86: cannot resolve symbol
    symbol : class Book
    location: class org.apache.jsp.BookSerialize_jsp
    Book book = new Book();
    ^
    The Book.class (and other classes) is in the WEB-INF/classes directory. The BookSerialize.jsp is here:
    <%@ page language="java" import="java.beans.XMLEncoder, java.beans.XMLDecoder, java.io.*"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html locale="true">
    <head>
    <html:base/>
    <title><bean:message key="index.title"/></title>
    </head>
    <body bgcolor="white">
    <h2>Book Serialization</h2>
    <%
    Book book = new Book();
    book.setTitle("A great Book about Struts");
    book.setPages(100);
    out.println("<member>First Title: " + book.getTitle() + "</member>");
    try {
    XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream("/Sample.xml")));
    encoder.writeObject(book);
    encoder.close();
    } catch(Exception ex) {
    out.println(ex);
    book.setTitle("A great Book about Struts, Second Edition");
    out.println("<member>Second Title: " + book.getTitle() + "</member>");
    try {
    XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream("/Sample.xml")));
    book = (Book) decoder.readObject();
    decoder.close();
    } catch(Exception ex) {
    out.println("<h1>" + ex + "</h1>");
    out.println("<member>Third Title: " + book.getTitle() + "</member>");
    %>
    </body>
    </html:html>
    I also get the same error when deploying and (trying to) run on the J2EE 1.3.1 server.
    So far, I just used JSP pages working with beans (usebean tag). Is it possible at all to just do a
    MyClass myObject = new MyClass();
    within a JSP page, if MyClass.class is in the WEB-INF/classes of the web application?
    Is there any kind of import missing? Book.class is in the default package, so i can't state it in the page directive/import parameter of the JSP page...
    any advice?

    I think, I got it: you have to use package names for your classes and avoid the default package. After I used a package name, it was possible to instantiate the object ....

  • Dynamic Tree Creation using JSP, Struts framework

    I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
    Tree is the hierarchical folder structure that we see in windows operating system.
    Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
    Tree should be done using JSP (& if required Javascript).
    I am using Struts framework .
    [email protected]

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

  • Reading Byte [] in JSP - Struts

    Hi,
              I am storing PDF files as BLOB object in Oracle 9i Database.
              In my struts action class I am reading the file and converting it into byte [].
              I am storing this value in the session as an object and while reading in the JSP,I am getting only null.
              But when I check the size of the byte [], it says 7,which is the actual length.
              How to read the byte [] and put it session?
              Any suggestions.
              Regards,
              Ram

    Hi Kris,
              Thank you for your inputs.
              I have tried this option also.
              Still I am getting the same issue like the "File does not begin with %PDF-".
              Actually I am getting the byte[] in my DAO class and passing that value to the action class by way of list.
              In my action class I am doing the below code.
              List lstResult = new ArrayList();
              byte[] byteArray = (byte[]) lstResult.get(0);
                             smCat.debug("DailySalesReportAction - b4 byte array");
                             // write data to output stream of response object
                             try {
                                  st = objHttpResponse.getOutputStream();
                                  smCat.debug("DailySalesReportAction - inside try");
                                  objHttpResponse.setContentType("application/pdf");
                                  objHttpResponse.setContentLength(byteArray.length);     
                                  objHttpResponse.setHeader("Content-Disposition","inline");
                                  st.write(byteArray);
                                  st.flush();
                                  st.close();
                             } catch (IOException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
              My DAO looks like this.
              public byte[] executeBlobQuery(String strQuery) {
                        java.sql.Connection vendorConn = null;
                             Blob blobResult = null;
                             int lob_length = 0;
                             BufferedInputStream bufferedInStream = null;
                             java.io.OutputStream os = null;
                             byte[] byteBuffer = null;
                             smCat.debug("Entering in executeBlobQuery DAO***************> ");
                             try {
                                  try {
                                       mConnection = getConnection();
                                  } catch (Exception e) {
                                       smCat.error(e.getMessage());
                                  // Create a static JDBC statement
                                  Statement m_stmt = mConnection.createStatement();
                                  mConnection.setAutoCommit(false);
                                  m_stmt.setFetchSize(10000);
                                                      ResultSet m_rs = m_stmt.executeQuery(strQuery);
                                  // Increment the result set
                                  if(m_rs.next()){
                                  smCat.debug("strQuery "+strQuery);
                                  //blobResult = ((OracleResultSet) m_rs).getBLOB("REPORT");
                                  //blobResult = m_rs.getBlob("REPORT");
                                  //byteBuffer = m_rs.getBytes("REPORT");
                                  //System.out.println("Length is --> "+byteBuffer.length);
                                  os = ((OracleThinBlob)blobResult).getBinaryOutputStream();
                                  smCat.debug("Blob Retrived ");
                                  //image = (oracle.sql.BLOB)m_rs.getBlob(1);
                                  lob_length = (int) blobResult.length();
                                  smCat.debug("Value is --> " + lob_length);
                                  byteBuffer = new byte[lob_length];
                                                 int length = -1;
                                                 os.write(byteBuffer);
                                  smCat.debug("Value of byteBuffer --> " + byteBuffer.length);
                                                 os.flush();
                                  mConnection.commit();
                                                 os.close();
                                  bufferedInStream =
                                       new BufferedInputStream(blobResult.getBinaryStream());
                                  byteBuffer = new byte[lob_length];
                                  bufferedInStream.read(byteBuffer, 0, lob_length);
                                  bufferedInStream.close();
                             } catch (SQLException sqe) {
                                  smCat.error(sqe.getMessage());
                             catch (IOException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
              Ram

  • Oracle portal using JSF, JSP, Struts framework

    Hi ,
    Can anyone tell me how to build an oracle portal using JSF,Jsp and Struts Framework.
    Also please provide any manual or documentation for developing oracle portal.
    Thanks in Advance,
    Raghav

    At present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

  • Jsp:forward URL problem

    Hi,
    I have 2 pages X.jsp and Y.jsp
    The content of X.jsp is a simple
    // send an email here
    <jsp:forward page="Y.jsp">
    </jsp:forward>
    The content of Y.jsp is only "Mail is sent" message.
    The problem is that everytime page X is loaded,
    the browser displays Y.jsp content, but the URL in the Address box of the browser still displays X.jsp
    This leads me to reload problem, even though the page displays the "Mail is sent" message, the URL still shows X.jsp, and everytime the browser is reloaded, another mail is sent.
    How to make the URL change to Y.jsp ?
    TIA.

    Hi,
    I have 2 pages X.jsp and Y.jsp
    The content of X.jsp is a simple
    // send an email here
    <jsp:forward page="Y.jsp">
    </jsp:forward>
    The content of Y.jsp is only "Mail is sent" message.
    The problem is that everytime page X is loaded,
    the browser displays Y.jsp content, but the URL in the
    Address box of the browser still displays X.jsp
    This leads me to reload problem, even though the page
    displays the "Mail is sent" message, the URL still
    shows X.jsp, and everytime the browser is reloaded,
    another mail is sent.
    How to make the URL change to Y.jsp ?
    TIA.Thats the natural behavious of forward.
    One simple solution is not to use forward. You can use HTTP redirection rather than forward.
    Hope it helps.

  • Newbie to JSP/Struts: Where to get started

    I would like to begin experimenting with JSP and the struts framework. I'm a java newbie but a relatively quick learner.
    First, what products do I need to use struts/JSP ?
    I have 9iAS standard edition release 1.0.2.1 and an oracle database std edition without the JVM installed. Do I need the JVM in the database ? Can JSP use a JVM outside the database ? Do I need enterprise edition ?
    Do I need Jdevelopper 9i or can I learn to use JSP with simple tools (HTML editor) first ?
    Does struts need JSP 2.0 spec or the JSP 1.1 that comes with iAS 1.0.2.1 is OK ? Is JSP 2.0 = JSP 1.2 (Like J2EE = JDK1.2 and up) There is a lot of version/naming confusion going on in java, you got any site that can help me untangle this mess ?
    Thanks a lot
    You can reply to [email protected]

    Thanks for your response.
    We actually use oracle 8.1.7 and 9iAS (PL/SQL gateway and http server). We would like to jump on the Java Bandwagon before we are left in the dust. We first need to be able to understand a lot of technology/concepts/buzzwords.
    We started basic Java programming (Applications) but would prefer to get an idea of "The big picture".
    By that, I mean, we need to be able to understand/design/architect sound applications and be able to talk to the community and understand what they are saying. Right now, reading the media or forums is just a big bunch of buzzwords that are ever changing and we cannot get a grasp on it.
    We not only need to get aquainted with the concepts, but we also need to be able to determine wether product xyz fits in the architecture, etc...
    If you were to get a couple of good books to answer some questions, where would you begin ?
    Kind of questions we might have are:
    - What is the difference between Jserv and Tomcat ?
    - What excatly is tomcat ? A replacement for Jserv ?
    - Can Jserv be used as a container for struts apps or do you need tomcat ? If you need tomcat, does it come with some version of 9ias ?
    - What is a java web service ?
    - I read a lot about Enterprise Java Beans etc.. What are they, what are there purpose ? It seems like it is a standard, what are they used for ? If it is a standard, does this mean that If I buy a set of EJB from a vendor, it would offer the same beans as another vendor ? Is Oracle BC4J an implementation of EJB with added functionality ? Is it proprietary ?
    - Buzzwords everywhere: MVC, EJB, J2EE, BC4J etc.. What are the definitions.
    - Is oracle's java vision proprietary or are they really following the rest of the world ? For example, is BC4J compatible with EJB ?
    - What is a Framework
    - What exactly is JSP.
    - Can STRUTS be used to access an oracle database ? If so, what are the required components (I guess you need JDBC or SQLJ) but does the oracle database need to be java enabled ?
    - Even if you use oracle 9ias as an application server, can you use non-proprietary development methods/architectures/techniques that could be easily implemented somewhere else using another vendor's application server (Ex: Apache + Tomcat, WebSphere, etc...)
    - Struts seems to be an interesting thing. I see that it was developped to encourage code reuse and prevent everyone from reinventing the wheel. But I cannot understand what exactly a developper had to write before struts was there. I mean, there must be alternatives to strut, if so what is the purpose of the framework ?
    A lot of questions, but we need to understand the basics before we jump on the java bandwagon. If we wait, we'll be left in the dust and we need to keep current.
    Thanks in advance.

  • Jsp, struts, problem in session invalidation

    Hello,
    Though have seen many topics here related to this, still cudn't get a proper solution. I'm having a struts application with many jsp's. have used session.invalidate for expiring sessions. Now the problem is my jsp have both button specific action and <html:link> forwards. tried including "response.setHeader("Cache-Control", "no-cache"); //Forces caches to obtain a new copy of the page from the origin server
    response.setHeader("Cache-Control", "no-store"); //Directs caches not to store the page under any circumstance
    response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
    response.setHeader("Pragma", "no-cache"); //HTTP 1.0 backward compatibility"
    got it from one of the topics here only.
    Now when i logout from any of my jsp and press back button of browser, the jsp's having struts specific action(http://...../xyz/edituser.do)works fine but forward specific jsp's(http://...../xyz/edit.jsp) is not redirecting to my login page(page not found error :- /xyz/edit.jsp). Also what if i press the browser back button more thn once????? weather this thing works on client side???at the moment in my application even the action specific logout is not working.........how can i solve this problem elegantly?????

    I faced same problem.
    I used below code.
    This code in every Authorized page.
    <%
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.setDateHeader("Expires", 0);
    response.setHeader("Pragma","no-cache");
    %>
    <%
    String username=(String) session.getAttribute("user");
    if(null==username)
         response.sendRedirect("../jsp-modLogin/login.jsp");
    }This code in logout page
    <%
    session.removeAttribute("user");
    session.invalidate();
    response.sendRedirect("../index.jsp");
    %>For me, It is working fine...
    Check it with ur code
    Regards
    Ramesh

  • JSP, Struts question - novice

    Hi,
    I'm new to Struts and am trying to get the hang of it.
    Here's what I am trying to do.
    In my action class:
    Collection b_list = DM.findAllById();
    request.setAttribute("fields1", b_list);
    Here, DM is a java class and the findAllById method returns an ArrayList. Each item in the array list is lets say of the type: abc(String id, String value) with getId() and getValue() implemented in that class.
    Now in my JSP:
    I do not have a form bean asssociated with it. Infact, I do not want to submit any data from this. I simply want to show a drop down menu box with all items from the collection.
    But I presume I need to create a bean using the object I have added to the request object.
    So, I'm trying to do this: (i dont know if I need property="id" for html:select tag as I dont want to submit anything.
    <logic :p resent parameter="field1">
    <bean :p arameter id="mylist" name="field1"/>
    <html:select property="id">
    <html :o ptionsCollection label="id" name="myList" value="value"/>
    </html:select>
    </logic :p resent>
    OR
    <html :o ptions collection="myList" property="value" labelProperty="id"/>
    instead of html :o ptionsCollections
    Is this correct? I cant get it to work. Am I missing something?
    I do not want to submit any info from this jsp. My jsp (a popup actually) simply uses a javascript function to update something in the previous JSP.
    Also, please note that I am NOT using LabelValueBean and am passing the Collection in the request object and TRYING to create a bean on the fly using the Collection of objects in the JSP.

    I do not have a form bean asssociated with it.
    Infact, I do not want to submit any data from this. I
    simply want to show a drop down menu box with all
    items from the collection.and then do what with the selected value?
    makes no sense to me. (or i'll learn something, too.) put a form in there and send the selection back to the controller servlet. everything from a page has to go back to the controller.
    I do not want to submit any info from this jsp. My
    jsp (a popup actually) simply uses a javascript
    function to update something in the previous JSP.this defeats the purpose of struts and the front controller, if i understand it correctly. that puts page navigation inside pages, and that's exactly what struts is supposed to remove.
    you're not using struts right by doing this, imo.
    %

Maybe you are looking for