Dynamically Sized JSPs

Hello:
I'm looking for some information in regard to...
What is the equivalent of Struts DynaForms in regular JSP?
I have developed an application using Struts - where I use DynaForms, Indexed Properties and such on a JSP - and we are having a problem trying to run that app in our production env which uses iPlanet.
So, I'm looking for an alternative to achieve the same functionality without using DynaForms (i.e.) construct a dynamically sizeable JSP based on DB results, (e.g.) a JSP displaying a class' student list with ability to edit the data shown.
Since I'm new to this technology, I do not know how this can be achieved.
Any pointers/ideas please...
Thanks in advance.

I am not able to clearly get ur problem, Is that u r trying to get a indexed property from the JSP and ur not able to handle it with struts????
Can u be more specific with the piece of code and the error.......
-Bala

Similar Messages

  • How to set the charset encoding dynamically in JSP

    Is there any way to set the charset encoding dynamically in a JSP
    page?
    we are using weblogic 6.1 on HP unix.
    is there some way we can set the charset dynamically in the page directive
    <%@ page contentType="text/html;charset=Shift_JIS" %>
    and in MAET tag
    <meta http-equiv="Content-Type" content="text/html" charset="Shift_JIS">
    Saurabh Agarwal

    Dear Saurabh,
    I guess it is possible. Here is an example I have made some time ago :
    In my html page :
    <form name="form1" METHOD=POST Action=Lang ENCTYPE="application/x-www-form-urlencoded" >
    <p>
    <select name="code" size="1">
    <option value="big5">Chinese</option>
    <option value="ISO-2022-KR">Korean</option>
    <option value="x-euc-jp">Japanese</option>
    <option value="ISO-8859-1">Spanish</option>
    <option value="ISO-8859-5">Russian</option>
    <option value="ISO-8859-7">Greek</option>
    <option value="ISO-8859-6">Arabic</option>
    <option value="ISO-8859-9">French</option>
    <option value="ISO-8559-1">German</option>
    <option value="ISO-8859-4">Swedish</option>
    <option value="ISO-8859-8">Hebrew</option>
    <option value="ISO-8859-9">Turkish</option>
    </select>
    </p>
    <p>
    <textarea name="entree_text"></textarea>
    <input type="submit" name="Submit" value="Submit" >
    </p></form>
    and in my jsp :
    // Must set the content type first
    res.setContentType("text/html");
    code = req.getParameter("code");
    example = req.getParameter("entree_text");
    PrintWriter out = res.getWriter();
    // The Servlet send to the Browser the informations to format the language type
    out.println("<html><head><title>Hello World!</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset="+code+"\"></head>");
    // System recover the general Character encoding
    String reqchar = req.getCharacterEncoding();
    out.println("<body><h1>Hello MultiLingual World!</h1>");
    out.println("You have defined an ISO of : "+code);
    out.println("<BR>This is the code of the page that is displayed in this page<BR>");
    out.println("<BR>");
    out.println("<BR>");
    out.println("Character encoding of the page is : "+reqchar);
    out.println("<BR>This is the character code in the Servlet");
    out.println("<BR>");
    out.println("<BR>");
    out.println("<BR>");
    out.println("You have typed : "+example);
    out.println("<BR>");
    out.println("");
    out.println("</body></html>");
    I think starting from this example it is surely easy to modify dynamically the jsp.
    The other possibility would be to use the Weblogic Commerce and the LOCALIZE function, so that you'll have an automatic redirection to the right jsp-encoding depending on the customer's language.
    Feel free to reply on the forum for any related issue.
    Best regards
    Nohmenn BABAI
    BEA EMEA Technical Support Engineer
    "Saurabh" <[email protected]> a écrit dans le message de news: [email protected]...
    Is there any way to set the charset encoding dynamically in a JSP
    page?
    we are using weblogic 6.1 on HP unix.
    is there some way we can set the charset dynamically in the page directive
    <%@ page contentType="text/html;charset=Shift_JIS" %>
    and in MAET tag
    <meta http-equiv="Content-Type" content="text/html" charset="Shift_JIS">
    Saurabh Agarwal[att1.html]

  • Dynamic sizing of a component to fit the content

    Hi All,
    How can I make my component so that it will be dynamically sized to fit the content height?  I would like to create a component that will have a variable height.  It has a serious of user input controls.  Depending on the answers given, more input from the user may be necessary--specifically, they will have to provide an explanation in a textbox.
    So, my thinking is that I don't want to display the textbox unless they answer "yes" to any questions that require additional explanation.  If they do, then I want display the TextArea control along with instructions to enter an additional explanation here.
    However, when I do that, it will cause my component's height to grow.  I don't want to reserve space for that textbox in the component's dimensions--I would prefer it simply grow (pushing anything below it further down) if and when the textbox appears.
    How would I go about doing this?
      -Josh

    I think the standard JSF solution would be not to do the create/delete of inputs on the client side, but to do it on the server side.
    If that is not your cup of tea, I think that the standard components will not be sufficient. So you are looking at either not binding the inputs to a component and just getting the values via the request parameters or creating a custom component capable of dealing with this.

  • Dynamically include jsp:param

    Is it possible to include <jsp:param> inside <jsp:forward> dynamically? There are two ways:
    1)
    <jsp:forward ...>
    <% if (...) { %>
         <jsp:param ... />
    <% } %>
    </jsp:forward>
    2)
    <jsp:forward ...>
    <util:if predicate="...">
         <jsp:param ... />
    </util:if>
    </jsp:forward>
    assuming <util:if> is some kind of conditional evaluation tag.
    The JSP 1.2 pfd2 says:
    The jsp:param element is used to provide key/value information. This element is
    used in the jsp:include , jsp:forward and jsp:params elements. A translation
    error shall occur if the element is used elsewhere.
    This seems to indicate that 2) is not allowed, but it is not clear whether or not 1) is allowed.
    I think it is desirable to allow both methods of dynamically including jsp:param elements.
    Any comments?

    1. doesn't work. You're not allowed to have <% %> scriplets inside of a jsp:forward tag. You can however include <%= %> tags. So you could set the value of a parameter dynamically and include the in the jsp:param tag
    2. I don't know about.
    -Derek

  • Creating dynamic sized arrays and filling them automatically on speedy 33

    hi all,
    I am trying to create dynamic sized arrays on Speedy-33. Specifically, depending on the user input, I want to be able to create
    arrays with 128 or 256 elements and fill them automatically. However,
    array constant element is fixed for Speedy 33; thus I have to manually set the
    size of the array with the mouse and enter the values in to the array by
    myself. I want to make this tedious process automatic. Would this be possible? thanks so much for comments!
    ~casiopea

    Casiopea,
    There is a really great article on using arrays with LabVIEW DSC which can be found here:
    How Can I Be Successful With Arrays In the LabVIEW DSP Module?
    One of the biggest things that should be noted about DSP is that there is no dynamic memory allocation.  Your array size must be fixed, and thus, your array needs to be initialized by using a constant. 
    An easy way to initialize an array constant that has many elements that are all the same is to simply create a numeric constant that has the value that you want.  Then, create a new blank array constant and drag the numeric into it.  In the index input for the array constant, type in the index of the last element that you want to be initialized.  Then type in the value in the element that is displayed and all of the elements before it will be initialized to the default value of the numeric constant that you dropped into the array constant.  I hope this helps.  I would really recommend reading through that article, as it has a lot of great information about using arrays with DSC.
    Brian Coalson
    Software Engineer
    National Instruments

  • How to change images dynamically in jsp?

    Hi All,
    i Want to know how to change images dynamically in jsp, for example in any site if u look at advertise or any images, it will be changed after every few seconds.
    Please guide me
    Thanks
    Sandesh S

    sandeshas wrote:
    Hi BlusC,
    i was searching your mail Id to ask the question directly to u,i checked in your blog also, but i didnt get,I want to keep my email spam safe. Only trusted people and direct friends have it. Just use the forums for discussion.
    my question is suppose if i want to display and change the advertise(adds from different company ) in my web site,how can i do it by using jsp?
    Do i need to create animated gifs which contains all company adds??one might be from movie add,after few seconds next one migth be some other web site add like that, how can i achieve this in my servet,jsp or using struts.You create animated gifs with an [animated gif editor|http://google.com/search?q=animated+gif+editor]. There is nothing what JSP can do for you here.

  • Catch Exception for dynamic Include jsp:include

    I have a page (says pageA.jsp) that should include other file dynamically. (<jsp:include page="<%=includedFile%>" flush="true"/>)
    However, if there is error in the included file, can pageA.jsp redirect to the error page stated in the page attribute instead of including the error message in pageA.jsp?
    Thanks

    So here is a solution, not an optimal one I think but it should be ok if URL are all absolute. Note a "/" is add to be sure when including.
    <%
    if ( new java.io.File(application.getRealPath(aae.getUrlCont())).exists() ) {
    %>
    <jsp:include page='<%="/"+aae.getUrlCont()%>'/>
    <%
    } else {
    %>
    <jsp:forward page="/error.jsp"/>
    <%
    now, it is a valid code for html, jsp or others file type.

  • Please!!!!!!   How can i add rows in html table dynamically [use jsp,bean]

    hello, i am a fresher in jsp. i want to add new rows in html table dynamically.In my coding, just only shows in one row . please help my problem with correct coding and i don't want to use database. Thanks ...............!
    Here is my coding-------------------
    ---------------- form.jsp --------------------->
    <%@ page import="java.util.*,newtest1.Validation" %>
    <jsp:useBean id="mybean" scope="page" class="newtest1.Validation" />
    <jsp:setProperty name="mybean" property="name" param="name" />
    <jsp:setProperty name="mybean" property="age" param="age" />
    <% s[i][j] %>
    <html>
    <head><title>Form</title></head>
    <body>
    <form method="get">
    <table border="0" width="700">
    <tr>
    <td width="150" align="right">Name</td>
    <td width="550" align="left"><input type="text" name="name" size="35"></td>
    </tr>
    <tr>
    <td width="150" align="right">Age</td>
    <td width="550" align="left"><input type="text" name="age" size="35"></td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr><td> </td></tr>
    <tr><td><input type="submit" name="submit" value="ADD"></td></tr>
    <tr><td> </td></tr>
    <tr><td width="100%" align="center" border=1>
    <% int count=mybean.getStart();
    for(int i=count; i<count+1; i++) { %>
    <tr>
    <td><jsp:getProperty name="mybean" property="name" /></td>
    <td><jsp:getProperty name="mybean" property="age" /></td>
    <td><%= count %></td>
    <% count+=1; %>
    </tr>
    <% } %></td></tr>
    </table>
    </form>
    </body>
    </html>
    ----------------- Validation.java ----------------->
    package newtest1;
    import java.util.*;
    public class Validation {
    private String name;
    private String age;
    static int start=0;
    public Validation() {    name=null;
    age=null;
    ++start;}
    public void setName(String username) { if(username!="")
    name=username;
    public String getName() { return name;  }
    public void setAge(String userage) {  if (age!="")
    {age=userage;}
    public String getAge() {  return age;   }
    public int getStart() {
    return start; }

    Hi, Do you mean to say,
    You have an HTML page in which you have a text field and an add button. If you enter anything in that text field and click on Add button the text field contents should be displayed in the same HTML page and you should be able to go on entering new values into the text field and you should be able to retain and display all the previously entered values..
    and finally the list of added items are not stored in the database..
    If this is the case
    i. Your html form should be submitted to the same page.
    ii. You need to have a Vector which holds the entered values.
    iii. Bind the vector object to the request object and collect the same vector object from the request and display its contents...
    I think this would help...

  • How to assign the class value dynamically  in jsp:useBean ?its urgent

    Hi
    I want to set the class value of <jsp:useBean> dynamically
    when i am trying to this way
    <jsp:useBean id="<%=id %>" class="<%=beanclass %>" scope="request">
    <jsp:setProperty name="<%=id %>" property="*"/>
    </jsp:useBean>
    where beanclass is .class file that is to be used by the usebean tag
    i am getting following error
    The value for the useBean class attribute <%=beanclass %> is invalid.
    please help as soon as possible
    regards,
    Rameshwari

    You can not do that.The jsp:useBean and jsp:setProperty are action tags and not custom tags. Action tags get translated into Java code in the translation unit and are then compiled. Custom tag are backed by classes and the tag get translated into a method call of the class.

  • How to access a variable from a dynamically included JSP page

    I have a jsp (say main.jsp) using the following in its code :
    <jsp:include page="menu.jsp" flush="true" />
    I have a variable in menu.jsp which I would like to use in my main.jsp.
    How do I get the value of the variable defined in menu.jsp ?
    I called this variable in menu.jsp, Public, but this didnot help me use the value of that variable in main.jsp
    Any help is highly appreciated.. thnks a lot

    I do notice the variable var1 has the value populated - in menu.jsp - (from View -->
    Source in the browser) but for some reason not able to use it in main.jspI'm not quite sure of the way your jsps are structured from your code snippet but I think there is something to be aware of here that may be part of your problem, namely the difference between the include directive and the include action.
    You are currently using the include action, this treats the included resource as a dynamic object - i.e. a request is sent to that resource and the resulting response is included in your page. So when you think of what there is no java variable actually included - you'll just get the resulting HTML that is generated by menu.jsp
    The include directive, as in <%@include file=�menu.jsp � %>, on the other hand treats the resource as a static object. This means the actual bytes in the included resource are inserted into the including jsp and then the result of that is compiled and processed, effectively you are cutting and pasting the menu.jsp into your calling jsp. In this case the variable would be available to the calling jsp.
    However this approach does bring other difficulties that may break your current code, you'll just have to try it and see what happens.
    Hope that's relevant to your problem,
    Matt

  • Proble displaying images dynamically in jsp

    Hi, I am new here. I have to display the images dynamically reading from a database. I have no problem displaying images. When i try to reduce the width in img tag then it is slowly rendering it. How to overcome this.
    <img src="image.jsp?imgID=112" width="150" heigth="130" border="0">
    I am also giving the sample jsp to display
         byte [] imgData = blob.getBytes(1,(int)blob.length());
    response.setContentType("image/jpeg");
    OutputStream o = response.getOutputStream();
    o.write(imgData);
    I want to display the image without any time taken. How could I solve this. Please Help me.
    Thanks.
    Phani.

    You should not crosspost questions. It is rude and a waste of our time.
    Please stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5372144].

  • How to populate the combo boxes that are created dynamically in jsp

    Hi,
    I am using JSP.
    I am creating combo boxes dynamically (based on the num selected by the user). These dynamically created combo boxes need to have A-Z as options (each box) . Now, when the user chooses the option A in any of the combo-boxes,the rest should not have this option. so on..
    how do i achieve this.Kindly help.

    You'll need to use JavaScript...I have a complicated example and a simple example, however, I cannot really understand the complex example but I know how it works. The looping is too complex for me.
    First you'll need to populate a server side variable...depending on how often the data is updated you may want this to run each time a new session is created...this example is run each time Tomcat is started and the application context is initialized:
    package kms.web;
    // Servlet imports
    import javax.servlet.ServletContextListener;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContext;
    // utility imports
    import java.util.Map;
    // domain imports
    import kms.domain.LocationService;
    import kms.domain.DeptService;
    import kms.domain.PatentService;
    * This listenter is used to initialize
    * the Maps of Locations, Patents & Depts used to populate
    * pulldown lists in JSPs
    public class InitializeData implements ServletContextListener {
        * This method creates the Maps.
       public void contextInitialized(ServletContextEvent sce) {
          ServletContext context = sce.getServletContext();
          LocationService lServ = new LocationService();
          // Create the Maps
          Map campuses = lServ.getCampuses();
          Map buildings = lServ.getBuildings();
          Map floors = lServ.getFloors();
          Map locs = lServ.getLocations();
          // And store them in the "context" (application) scope
          context.setAttribute("campuses", campuses);
          context.setAttribute("buildings", buildings);
          context.setAttribute("floors", floors);
          context.setAttribute("locs", locs);
          DeptService dServ = new DeptService();
          Map depts = dServ.getDepts();
          context.setAttribute("depts", depts);
          PatentService pServ = new PatentService();
          Map patents = pServ.getPatents();
          context.setAttribute("patents", patents);
          //I did this one myself
    /*    CodeService cServ = new CodeService();
          Map masterMks = cServ.getCodes();
          context.setAttribute("masterMks", masterMks);
        * This method is necessary for interface.
       public void contextDestroyed(ServletContextEvent sce) {
       // I have no clue what the heck this is for???
       // Let me know if you do!
    }So now we travel into the PatentService method called 'getPatents();' which in turn calls a PatentDAO method
    Map patents = pServ.getPatents();
    Below is the code for the PatentService object:
    package kms.domain;
    import kms.util.ObjectNotFoundException;
    import java.util.*;
    * This object performs a variety of dept services, like retrieving
    * a dept object from the database, or creating a new dept object.
    public class PatentService {
       * The internal Data Access Object used for database CRUD operations.
      private PatentDAO patentDAO;
       * This constructor creates a Dept Service object.
      public PatentService() {
        patentDAO = new PatentDAO();
    public Map getPatents() {
          Map patents = null;
          try {
            patents = patentDAO.retrieveAll();
          // If the dept object does not exist, simply return null
          } catch (ObjectNotFoundException onfe) {
            patents = null;
          return patents;
    }It may be useful for you to see the code of the Patent class:
    package kms.domain;
    /*** This domain object represents a dept.
    public class Patent implements java.io.Serializable {
      private int codeGgm;
      private String name = "";
      private String description = "";
      private int creator;
      private String creationDate = "";
      private int used;
       * This is the full constructor.
      public Patent(int codeGgm, String name, String desc, int creator, String creationDate, int used) {
        this.codeGgm = codeGgm;
        this.name = name;
        this.description = desc;
        this.creator = creator;
        this.creationDate = creationDate;
        this.used = used;
      public Patent() { }
      public int getCodeGgm() {
          return codeGgm;
      public void setCodeGgm(int codeGgm) {
           this.codeGgm = codeGgm;
      public String getName() {
        return name;
      public void setName(String name) {
          this.name = name;
      public String getDesc() {
        return description;
      public void setDesc(String desc) {
          this.description = desc;
      public int getCreator() {
          return creator;
      public void setCreator(int creator) {
             this.creator = creator;
      public String getCreationDate() {
          return creationDate;
      public void setCreationDate(String creationDate) {
             this.creationDate = creationDate;
      public int getUsed() {
           return used;
      public void setUsed(int used){
           this.used = used;
    }And here is the Database table which stores the Patents:
    DESC PATENT:
    CODE_GGM NUMBER(3)
    NAME VARCHAR2(15)
    DESCRIPTION VARCHAR2(250)
    CREATOR NUMBER(10)
    CREATION_DATE DATE
    USED NUMBER(1)
    So, we then travel into the code of the PatentDAO to see how the DAO object executes the DB query to get all of the Data we need for the select list:
    package kms.domain;
    import javax.naming.*;
    import javax.sql.*;
    import java.util.*;
    import java.sql.*;
    import kms.util.*;
    * This Data Access Object performs database operations on Patent objects.
    class PatentDAO {
       * This constructor creates a Patent DAO object.
       * Keep this package-private, so no other classes have access
    PatentDAO() {
    * This method returns a Map of all the Dept names
    * The key is the Dept id
    Map retrieveAll()
           throws ObjectNotFoundException {
          Connection connection = null;
          ResultSet results = null;
          // Create the query statement
          PreparedStatement query_stmt = null;
          try {
            // Get a database connection
          Context initContext = new InitialContext();
           DataSource ds = (DataSource)initContext.lookup("java:/comp/env/jdbc/keymanOracle");
           connection = ds.getConnection();
            // Create SQL SELECT statement
            query_stmt = connection.prepareStatement(RETRIEVE_ALL_NAMES);
            results = query_stmt.executeQuery();
            int num_of_rows = 0;
          Map patents = new TreeMap();
             // Iterator over the query results
            while ( results.next() ) {
                patents.put(new Integer(results.getInt("code_ggm")), results.getString("name"));
             if ( patents != null ) {
                      return patents;
                    } else {
                      throw new ObjectNotFoundException("patent");
           // Handle any SQL errors
         } catch (SQLException se) {
            se.printStackTrace();
           throw new RuntimeException("A database error occured. " + se.getMessage());
        } catch (NamingException se) {
          throw new RuntimeException("A JNDI error occured. " + se.getMessage());
          // Clean up JDBC resources
          } finally {
            if ( results != null ) {
              try { results.close(); }
              catch (SQLException se) { se.printStackTrace(System.err); }
            if ( query_stmt != null ) {
              try { query_stmt.close(); }
              catch (SQLException se) { se.printStackTrace(System.err); }
            if ( connection != null ) {
              try { connection.close(); }
              catch (Exception e) { e.printStackTrace(System.err); }
    private static final String RETRIEVE_ALL_NAMES
          = "SELECT code_ggm, name FROM patent ";
    }Now when you wish to use the 'combo box' (also called select lists), you insert this code into your jsp:
    <TR>
    <%@ include file="../incl/patent.jsp" %>
    </TR>
    depending on how your files on your server are organized, the "../incl/patent.jsp"
    tells the container to look up one directory from where the main jsp is to find the 'patent.jsp' file in the 'incl' directory.
    I need some help creating multi-level select lists with JavaScript:
    Can anyone explain this code:
    <%@ page import="java.util.*,kms.domain.*" %>
    <jsp:useBean id="campuses" scope="application" class="java.util.Map" />
    <TR><TD ALIGN='right'>Campus: </TD>
    <TD>
    <select name="campus" size="1" onChange="redirect(this.options.selectedIndex)">
    <option value="0" selected>No Campus</option>
    <% LocationService ls = new LocationService();
       Iterator c = campuses.keySet().iterator();
       Map[] bm = new Map[campuses.size()];
       Map[][] fm = new Map[campuses.size()][0];
       Map[][][] lm = new Map[campuses.size()][0][0];
       int i2 = 0;
       int j2 = 0;
       int k2 = 0;
       int jj = 0;
       int kk = 0;
       while (c.hasNext()) {
          Integer i = (Integer)c.next();
          out.print("<OPTION ");
          out.print("VALUE='" + i.intValue()+ "'>");
          out.print( (String) campuses.get(i) );
          out.print("</OPTION>");
          bm[i2] =  ls.getBuildingsByCampus(i.intValue());
          fm[i2] = new Map[bm[i2].size()];
          lm[i2] = new Map[bm[i2].size()][];
          Iterator b = bm[i2].keySet().iterator();
          j2 = 0;
          while (b.hasNext()) {
            Integer j = (Integer)b.next();
            fm[i2][j2] = ls.getFloorsByBuilding(j.intValue());
            lm[i2][j2] = new Map[fm[i2][j2].size()];
            Iterator f = fm[i2][j2].keySet().iterator();
            k2 = 0;
            while (f.hasNext()) {
              Integer k = (Integer)f.next();
              lm[i2][j2][k2] = ls.getLocationsByFloor(k.intValue());
              k2++;
              kk++;
            j2++;
            jj++;
          i2++;
       } %>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Building: </TD>
    <TD>
    <select name="building" size="1" onChange="redirect1(this.options.selectedIndex)">
    <option value="0" selected>No Building</option>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Floor: </TD>
    <TD>
    <select name="floor" size="1" onChange="redirect2(this.options.selectedIndex)">
    <option value="0" selected>No Floor</option>
    </select></TD>
    </TR>
    <TR><TD ALIGN='right'>Room: </TD>
    <TD>
    <select name="location_id" size="1">
    <option value="0" selected>No Room</option>
    </select></TD>
    </TR>
    <script>
    var cNum = <%=i2%>
    var bNum = <%=jj%>
    var fNum = <%=kk%>
    var cc = 0
    var bb = 0
    var ff = 0
    var temp=document.isc.building
    function redirect(x){
    cc = x
    for (m=temp.options.length-1;m>0;m--)
      temp.options[m]=null
      temp.options[0]=new Option("No Building", "0")
      if (cc!=0) {
        for (i=1;i<=group[cc-1].length;i++){
          temp.options=new Option(group[cc-1][i-1].text,group[cc-1][i-1].value)
    temp.options[0].selected=true
    redirect1(0)
    var group=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group[i]=new Array()
    <% for (int i=0; i< bm.length; i++) {
    Iterator bldgs = bm[i].keySet().iterator();
    int j = 0;
    while (bldgs.hasNext()) {
    Integer intJ =(Integer) bldgs.next(); %>
    group[<%=i%>][<%=j%>] = new Option("<%=bm[i].get(intJ)%>", "<%=intJ%>");
    <% j++;
    } %>
    var group2=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group2[i] = new Array()
    for (j=0; j<=bNum; j++) {
    group2[i][j] = new Array()
    <% for (int i=0; i< fm.length; i++) {
    for (int j=0; j< fm[i].length; j++) {
    Iterator flrs = fm[i][j].keySet().iterator();
    int k = 0;
    while (flrs.hasNext()) {
    Integer intK =(Integer) flrs.next(); %>
    group2[<%=i%>][<%=j%>][<%=k%>] = new Option("<%=fm[i][j].get(intK)%>", "<%=intK%>");
    <% k++;
    } %>
    var temp1=document.isc.floor
    var camp=document.isc.campus.options.selectedIndex
    function redirect1(x){
    bb = x
    for (m=temp1.options.length-1;m>0;m--)
    temp1.options[m]=null
    temp1.options[0]=new Option("No Floor", "0")
    if (cc!=0 && bb!=0) {
    for (i=1;i<=group2[cc-1][bb-1].length;i++){
    temp1.options[i]=new Option(group2[cc-1][bb-1][i-1].text,group2[cc-1][bb-1][i-1].value)
    temp1.options[0].selected=true
    redirect2(0)
    var group3=new Array(cNum)
    for (i=0; i<cNum; i++) {
    group3[i] = new Array()
    for (j=0; j<=bNum; j++) {
    group3[i][j] = new Array()
    for (k=0; k<=fNum; k++) {
    group3[i][j][k] = new Array()
    <% for (int i=0; i< lm.length; i++) {
    for (int j=0; j< lm[i].length; j++) {
    for (int k=0; k< lm[i][j].length; k++) {
    Iterator locs = lm[i][j][k].keySet().iterator();
    int m = 0;
    while (locs.hasNext()) {
    Integer intM =(Integer) locs.next(); %>
    group3[<%=i%>][<%=j%>][<%=k%>][<%=m%>] = new Option("<%=lm[i][j][k].get(intM)%>", "<%=intM%>");
    <% m++;
    } %>
    var temp2=document.isc.location_id
    function redirect2(x){
    ff = x
    for (m=temp2.options.length-1;m>0;m--)
    temp2.options[m]=null
    temp2.options[0]=new Option("No Room", "0")
    if (cc!=0 && bb!=0 && ff!=0) {
    for (i=1;i<=group3[cc-1][bb-1][ff-1].length;i++){
    temp2.options[i]=new Option(group3[cc-1][bb-1][ff-1][i-1].text,group3[cc-1][bb-1][ff-1][i-1].value)
    temp2.options[0].selected=true
    </script>
    This produces a related select list with 4 related lists by outputting JavaScript to the page being served. It works the same way as the first example that I describe but I don't understand the looping...maybe someone could explain how to go from the single select list to a double and/or triple level drill down?

  • Issue with IE and dynamic JNLP (JSP)

    I'm trying to create a JNLP file using JSP to insert a dynamic argument into the webstarted (new word?) program. The link works fine in Firefox and Opera, but IE throws an error and says that it could not download the file. Here's my setup:
    JSP file (JNLP)
    LaunchClient.jsp
    <%@page contentType="application/x-java-jnlp-file"%>
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc.//DTD JNLP 1.5//EN" "http://www.netbeans.org/jnlp/DTD/jnlp.dtd">
    <%
        String projectRefID = request.getParameter("projectRefID");
    %>
    <jnlp codebase="http://127.0.0.1:8080/tssa/">
      <information>
        <title>AppTest</title>
        <vendor>Company, Inc.</vendor>
        <homepage href="homepage.html"/>
        <description> </description>
        <icon href="default"/>
        <offline-allowed/>
      </information>
      <resources>
        <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
      </resources>
      <resources>
        <jar download="eager" href="jars/AppTest.jar" main="false"/>
      </resources>
      <application-desc main-class="apptest.Main">
        <argument><%= projectRefID %></argument>
      </application-desc>
    </jnlp>My link to the above page looks like this:
    <a href="LaunchClient.jsp?projectRefID=<%=currProject.getReferenceIdentifier()%>" >CLICKME</a>I've added the following mime mappings to my web.xml:
        <mime-mapping>
            <extension>jnlp</extension>
            <mime-type>application/x-java-jnlp-file</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>jar</extension>
            <mime-type>application/java-archive</mime-type>
        </mime-mapping>I've also tried using a servlet mapping so the link will still have a .jnlp extension as follows:
      <servlet>
        <servlet-name>JnlpMapping</servlet-name>
        <jsp-file>/restricted/LaunchClient.jsp</jsp-file>
      </servlet>
      <servlet-mapping>
        <servlet-name>JnlpMapping</servlet-name>
        <url-pattern>/restricted/myProgram.jnlp</url-pattern>
      </servlet-mapping>My link then points to myProgram.jnlp instead of LaunchClient.jsp. But that has the same results (works in firefox/opera but not in IE). Does anyone see why IE is complaining? Do I have to break down and write a servlet?
    --Also: I'm using Sun Application Server PE 9
    Message was edited by:
    QSilver002

    I had the same problem. The resolution is preety simple. You can't set header Cache-Control to no-cache, becouse IE tries to cache it before running. That's why any java error occurs, just can't find the file error. What supprised me is that you can't even save the file with right click "Save the target as..", which seems to be little strange. Any other page of type type/html with this header make no problem with that.
    Conclusion:
    IE makes some special trick with a file of type application/x-java-jnlp-file. Cache-Control to no-cache couses not only disability of running the ws directly, but also saving it locally, which doesn't happen with text/html type of page.
    Sevage

  • How to display graphics dynamically in JSP

    I use JSP to call a servlet to get the output . The output is in svg format. I do not hope to create a svg file to store the output from servlet. I wope to embed the svg dynamically in the jsp page
    Anybody knows the solution. Many thanks in advance
    Cheers,
    .

    Because the output from Servlet is in text format not binary.
    So the tag <IMAG></IMAG> does not work .
    the output is similar as
    <svg viewBox="0 0 360 270">
    <style type="text/css"><![CDATA[
    .aS{ font-family: monospace; text-anchor: middle;
    font-size: 35px; stroke: Blue; fill: Red; }
    ]]></style>
         <g>
    <text x="60" y="90">+2%</text>
    <polyline points=" 110,80 110,80 210,80 210,80" />
    <text x="60" y="180">-2%</text>
    <line x1="110" y1="170" x2="210" y2="170" />
    <line x1="110" y1="120" x2="210" y2="120" />
    <text x="280" y="130">4:0</text>
    <text x="160" y="200">1</text>
    <text x="110" y="150">-</text>
    <text x="185" y="50">Sample - Name</text>
    <text x="185" y="240">Minutes/km (2003/1/7)</text>
         </g>
    </svg>
    If I keep the output as a **.svg file. then embed it in jsp. it is OK.

  • Dynamically altering JSP name

    Okay, here is my little problem:
    I have a Servlet that takes a bytearray and a MIME type and returns it as the binary object. I use it for example for displaying dynamic graphics in web pages. Now, I am doing the same for downloading a dynamically generated ZIP file. The way I do it is linking to a JSP, which then generates the ZIP bytearray and redirects to the servlet. Everything works fine.
    However, I would like to change the filename, since the download dialog always wants to store it as download.jsp where I would like a .zip extension to make it stupid-user safe. Is there any way to do this? There must be, since in the past I have used OpenCMS which allowed generation of JSPs with any kind of extension, internally added a .jsp and then sent it to the browser without the .jsp.
    Thanks for any hints,
    Matthias

    You can change the default filename using a HTTP response header:
    response.setHeader("Content-Disposition","attachment; filename=\"filename.zip\"");If I understand your situation correctly this should fix it. I'm not 100% sure about those double quotes around the filename though, if it doesn't work remove them and try again.

Maybe you are looking for

  • Help needed in Interactive report

    Hi, my requirement is: in first list, i have to display some sales orders from vbak. in second list, user has to select multiple sales orders by check boxes besides them & click on execute. in third list, sales orders(which is selected in second list

  • Itunes won't use my store credit, it prompts me for my credit card

    I was given a gift card for Christmas that I applied to my account. I made a purchase a recently as Feb 11 with it. At the top of the screen it tells me I have a $6.06 store credit left yet everytime I try to download a song it takes me to the credit

  • Count new records from Oracle function.

    Is it possible to count all the new records inserted? I have a script with a couple of insert statements, before I do commit all the actions done in the script I like to read the numbers of new records. I do not have a key that I can use to select th

  • ASM_PRIMARY_to_ASM PHYSICAL STANDBY

    HI All,    Can any one please share Some good documents for creating - ASM primary to ASM standby creation . any links... PRIMARY AND STANDBY: in ASM : Datafiles in +DATA01 archive in +FRA01 DB - 11gR2 OS - Linux-64 bit. using +FRA01 for archive dest

  • ORA-00235 Standby Database Controlfile problem

    Dear fellow dbas, I am just starting to become acquainted with high availability and have to solve following problem. We have a RAC database with a standby database that is out of sync. In fact the standby database is running in async mode but archiv