JSP language javascript

What is the problem?
<%@ page language="javascript" %>
<%
var i;
for ( i=1; i<5; i++ )
out.println("JSP whit JavaScript <br>");
%>

What is the problem?
<%@ page language="javascript" %>
<%
var i;
for ( i=1; i<5; i++ )
out.println("JSP whit JavaScript <br>");
%>The <% and %> tags indicate a Java scriptlet.
"var" is JavaScript syntax, the rest is Java.
out.println is a Java method.
If you want to do your loop in JavaScript then it would
be like this:
<script>
for ( var i = 1; i < 5; i++ )
document.writeln("JSP whit JavaScript <br>");
</script>

Similar Messages

  • How to access variables across JSP and JavaScript?

    Hi,
    I have some .js files and in those files, some of the methods need to access to the variables that I'd declare in the jsp files. How do I do it?
    Anne

    You can do it this way, but I'm not sure if this is what you had in mind.
    Say you had a java variable called XString. And you wanted to display
    the value of XString in a javascript Alert. Here's how:
    <html>
    <body>
    <% String XString = "Hi There!"; %>
    </body>
    <script language="javascript">
    alert("<%=XString%>");
    </html>Hope This Help,
    P.

  • Problem in JSP with JavaScripts, which works perfectly in TOMCAT

    The peice of code below works without any problem in tomcat, which assign some values from a form named "frmOffice" which is in another jsp. In 9iAS it seems the values are not found. Also it says 'error on page'. What could be the reason. Please respond as soon as possible. Thanks.
    <SCRIPT Language="JavaScript">
    function Opennewwindow(url,size)
    window.open (url,"Newwindow",size);
    function NewContact()
    var UserID =
    parent.parent.frmMenubar.document.frmOffice.UserID.value;
    var GroupID =
    parent.frmFolderHead.document.fomFolderHead.FolderID.value;
    var intDomainID =
    parent.parent.frmMenubar.document.frmOffice.DomainID.value;
    Opennewwindow('../../modules/contact/Contact_New.jsp?
    UserID='+UserID+'&GroupID='+GroupID+'&Email=&DomainID='+intDomainID,'scrollbars=1,width=680,height=190');
    </SCRIPT>

    Mr. Ahmed,
    Excuse-me by my bad english.
    I experienced the same problem when surrounded my scripts with comment caracters:
    <!--
    < SCRIPT ...
    -->
    If this is your case, simply uncomment it and the script will work fine.

  • Validating forms in jsp using javaScript

    Hi all i'm trying to validate this form with javeScript. i was testing it with just the <input type=text name= file> first. it works but after the alert message it still posts to writeXML......
    i tried putting the fuction valid() after the <form> tag but it still posts it to writeXML.jsp.......can anyone help me please........What i want to do is make sure that something is typed in all the forms befor posting to writeXML..Thanx
    <html>
    <head> <title>Create MultipleChoice Questions</title> </head>
    <script language="JavaScript">
    function valid(form) {
         if(form.file.value == "")
         alert("Please enter the file name")
    </script>
    <body bgcolor="#cccccc">
    <% int count = 0;
    String number = request.getParameter("nOfq");
    int qNumber = Integer.parseInt(number); %>
    <form action="writeXML.jsp" method="POST">
    <center>
         <table bgcolor="silver" border="1" width="75%">
         <tr align="center"><td><b>Type in the Name of your Questionnaire here eg. BlackHistory.      Dont leave any spaces between letters</b><br>
         <textarea name="file" rows="1" cols="25"></textarea><br>
         </td></tr>
    <% for(int i=1;i<qNumber+1; i++) { %>
    <%count++;%>
         <tr align="center" bgcolor="#336699"><td><b>QUESTION <%= count %>: </b><br>
         </td></tr>
         <tr align="center"><td><b>ENTER QUESTION:</b><br>
         <textarea name=<%="questionText"+i%> rows="5" cols="65"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 1:</b><br>
         <textarea name=<%="choice_1"+i%> rows="2" cols="50"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 2:</b><br>
         <textarea name=<%="choice_2"+i%> rows="2" cols="50"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 3:</b><br>
         <textarea name=<%="choice_3"+i%> rows="2" cols="50"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 4:</b><br>
         <textarea name=<%="choice_4"+i%> rows="2" cols="50"></textarea><br><br><br>
         </td></tr>
         <tr align="center" bgcolor="#679995"><td><b>CORRECT ANSWER:</b><br>
         <textarea name=<%="cAnswer"+i%> rows="2" cols="50"></textarea><br><br><br>
         </td></tr>
    <% } %>
    <tr>
    <td align="center"><input type="submit" name="next" value="NEXTT" onClick="valid(this.form)">
    <td align="center"><input type="hidden" name="qCount" value="<%=count+1%>">
    </td></tr>
    </table>
    </center>
    </form>
    </body>
    </html>

    this Corrected code works perfectly
    <html>
    <head> <title>Create MultipleChoice Questions</title> </head>
    <script language="JavaScript">
    function valid(form) {
    if(form.file.value == ""){
    alert("Please enter the file name");
    frmValid.file.focus();     
    }else{
         frmValid.action="writeXML.jsp";
         frmValid.submit();
    </script>
    <body bgcolor="#cccccc">
    <% int count = 0;
    int qNumber=-1;
    String number = clearNull(request.getParameter("nOfq"));
    if(! number.equals(""))
    qNumber = Integer.parseInt(number);
    %>
    <form name="frmValid" method="POST" >
    <center>
    <table bgcolor="silver" border="1" width="75%">
    <tr align="center"><td><b>Type in the Name of your Questionnaire here eg. BlackHistory. Dont leave any spaces between letters</b><br>
    <textarea name="file" rows="1" cols="25"></textarea><br>
    </td></tr>
    <% for(int i=1;i<qNumber+1; i++) { %>
    <%count++;%>
    <tr align="center" bgcolor="#336699"><td><b>QUESTION <%= count %>: </b><br>
    </td></tr>
    <tr align="center"><td><b>ENTER QUESTION:</b><br>
    <textarea name=<%="questionText"+i%> rows="5" cols="65"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 1:</b><br>
    <textarea name=<%="choice_1"+i%> rows="2" cols="50"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 2:</b><br>
    <textarea name=<%="choice_2"+i%> rows="2" cols="50"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 3:</b><br>
    <textarea name=<%="choice_3"+i%> rows="2" cols="50"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 4:</b><br>
    <textarea name=<%="choice_4"+i%> rows="2" cols="50"></textarea><br><br><br>
    </td></tr>
    <tr align="center" bgcolor="#679995"><td><b>CORRECT ANSWER:</b><br>
    <textarea name=<%="cAnswer"+i%> rows="2" cols="50"></textarea><br><br><br>
    </td></tr>
    <% } %>
    <tr>
    <td align="center"><input type="submit" name="next" value="NEXTT" onClick="valid(this.form)">
    <td align="center"><input type="hidden" name="qCount" value="<%=count+1%>">
    </td></tr>
    </table>
    </center>
    </form>
    </body>
    </html>
    <%!
    private String clearNull( String sField ) {
    return ( sField == null ) ? "" : sField;
    %>

  • JSP , bean, JavaScript

    I have a page that uses a bean, myBean. There is a method inside myBean named getOccupation() and a property String Occupation. the getOccupation returns the Occupation to the page. The Occupation String is gotten from a database.
    I also have a form in the jsp page named myForm and a select field named Occupation.
    The idea is, get the Occupation from the database, return it to the jsp and make the select select the corresponding to the String gotten from the database.
    I'm trying to mix javascript with java here
    javascript to compare the current values of the Options in select to the Occupation and select it but it keeps giving me the error.
    <script>
    blabla javascript
    <% myBean.getOccupation()%>
    </script>
    That gives an error, anyone can help?
    thx
    Dewi

    I think the below code might help you.....
    I tried to reproduce your problem.....
    <%!
         String selectValue = "1";
    %>
    <html>
         <head>
              <title>Test Page </title>
              <script language="JavaScript">
                   function as(){
                        obj = document.form1.test;
                        for (i = 1; i < obj.length; i++){
                             if (obj.value == '<%=selectValue%>')
                                  obj[i].selected = true;
              </script>
         </head>
         <body onload="as()">
         <form name="form1">
              <select name="test">
                   <option value="">---------select----------</option>
                   <option value="1">1</option>
                   <option value="2">2</option>
                   <option value="3">3</option>
                   <option value="4">4</option>
              </select>
         </form>
         </body>
    </html>
    I hope this works.....

  • How to call jsp in javascript

    i am trying to show a confirm dialog and when the user click on the ok button, i want it to call a method inside my .java file. what i want to do is something like this:
    <script>
    var ans = confirm("Are u sure you want to over write file);
    if(ans)
    //call the method doUpload
    else
    //do nothing
    </script>
    /////////////.java///////////////
    public class FileUploadBean{
    public void doUpload(HttpServletRequest req, HttpServletResponse res){

    Something along these lines ought to do what you want:
    <html>
    <body>
    <form name='foobar' action='foobar.jsp'>
    <script language='Javascript'>
    function askim() {
      if (confirm('Is you sure?')) {
        document.foobar.submit();
      } else return false;
    </script>
    <input type='button' value='Submit' onClick='askim()'>
    </form>
    </body>
    </html>
    Your mileage may vary.
    But the idea here is that the Javascript merely submits the form if the user clicks "OK" on the confirmation pop-up. Otherwise, nothing happens. The form is submitted to a JSP file which accepts the request, does something (such as call your Java class), then prints out some HTML in response.

  • Repost, since no answer in JSP-JSP/CascadingStyleSheet/Javascript problem

    Hello, I've got a JSP page that has included a Javascript (JS).
    In that JS, a Cascading Style Sheet (CSS) is included. Also on the JSP page, I have some code that makes use of the JS to create a Windows-style combobox, which is not available through raw HTML. The code is as follows:
    <BODY>
    <SCRIPT language="javascript" src="ComboBox.js"></SCRIPT>
    <SCRIPT language="javascript">
    dm=new ComboBox("dm")
    dm.add(
           new ComboBoxItem("barge",1),
           new ComboBoxItem("benluc",2),
           new ComboBoxItem("benlieeeeck",3),
           new ComboBoxItem("taco",4)
    </SCRIPT>
    <CENTER><H2>Choose Project S/O</H2><CENTER>
    <FORM METHOD=POST ACTION="">
    <% //DB connection to populate the combo box %>
    <% // Database Connection Parameters
        String DB = "dbname",
        query = "",
        HOST = "jdbc:postgresql://URL:5432/",
        ACCOUNT = "username",
        PASSWORD = "pwd",
        DRIVER = "org.postgresql.Driver";
        // authentication properties
        Properties props = new Properties();
        props.setProperty("user", ACCOUNT);
        props.setProperty("password", PASSWORD);
        // load driver and prepare to access
        Class.forName(DRIVER).newInstance();
        Connection con = DriverManager.getConnection(HOST + DB, props);
        Statement stmt = con.createStatement();
        try{
        query= "SELECT * FROM Projects ORDER BY Name";
        ResultSet rs = stmt.executeQuery(query);
    %>
    Project S/O:
    <SELECT NAME=projso>
    <option value="dummy">Choose one...</option>
    <% while (rs.next() ) { %>
    <OPTION VALUE="<%=rs.getString("Name") %>">
    <%=rs.getString("Name")%> ,   <%=rs.getString("Desc")%>
    </OPTION>
    <% } %>
    </SELECT>The problem I am experiencing is that if I move the 2nd SCRIPT tag anywhere but where it is, it makes IE bomb and takes me to an error page. The error message is as follows:
    "Internet Explorer cannot open site http://myURL. Operation aborted."
    Any ideas?
    Haig

    I tried making it static HTML with the same result.
    I took out all the JSP code before doing so, obviously.
    I think it has to do with my code and the HTML FORM tag.
    Anyway, here's the requested code, ComboBox.js
    *     ComboBox
    *     By Jared Nuzzolillo
    *     Updated by Erik Arvidsson
    *     http://webfx.eae.net/contact.html#erik
    *     2002-06-13     Fixed Mozilla support and improved build performance
    Global_run_event_hook = true;
    Global_combo_array    = new Array();
    Array.prototype.remove=function(dx)
        if(isNaN(dx)||dx>this.length){self.status='Array_remove:invalid request-'+dx;return false}
        for(var i=0,n=0;i<this.length;i++)
            if(this!=this[dx])
    this[n++]=this[i]
    this.length-=1
    function ComboBox_make()
    var bt,nm;
    nm = this.name+"txt";
    this.txtview = document.createElement("INPUT")
    this.txtview.type = "text";
    this.txtview.name = nm;
    this.txtview.id = nm;
    this.txtview.className = "combo-input"
    this.view.appendChild(this.txtview);
    this.valcon = document.createElement("INPUT");
    this.valcon.type = "hidden";
    this.view.appendChild(this.valcon)
    var tmp = document.createElement("IMG");
    tmp.src = "___";
    tmp.style.width = "1px";
    tmp.style.height = "0";
    this.view.appendChild(tmp);
    var tmp = document.createElement("BUTTON");
    tmp.appendChild(document.createTextNode(6));
    tmp.className = "combo-button";
         this.view.appendChild(tmp);
         tmp.onfocus = function () { this.blur(); };
         tmp.onclick = new Function ("", this.name + ".toggle()");
    function ComboBox_choose(realval,txtval)
    this.value = realval;
    var samstring = this.name+".view.childNodes[0].value='"+txtval+"'"
    window.setTimeout(samstring,1)
    this.valcon.value = realval;
    function ComboBox_mouseDown(e)
    var obj,len,el,i;
    el = e.target ? e.target : e.srcElement;
    while (el.nodeType != 1) el = el.parentNode;
    var elcl = el.className;
    if(elcl.indexOf("combo-")!=0)
    len=Global_combo_array.length
    for(i=0;i<len;i++)
    curobj = Global_combo_array[i]
    if(curobj.opslist)
    curobj.opslist.style.display='none'
    function ComboBox_handleKey(e)
    var key,obj,eobj,el,strname;
    eobj = e;
    key = eobj.keyCode;
    el = e.target ? e.target : e.srcElement;
    while (el.nodeType != 1) el = el.parentNode;
    elcl = el.className
    if(elcl.indexOf("combo-")==0)
    if(elcl.split("-")[1]=="input")
    strname = el.id.split("txt")[0]
    obj = window[strname];
    obj.expops.length=0
    obj.update();
    obj.build(obj.expops);
    if(obj.expops.length==1&&obj.expops[0].text=="(No matches)"){}//empty
    else{obj.opslist.style.display='block';}
    obj.value = el.value;
    obj.valcon.value = el.value;
    function ComboBox_update()
    var opart,astr,alen,opln,i,boo;
    boo=false;
    opln = this.options.length
    astr = this.txtview.value.toLowerCase();
    alen = astr.length
    if(alen==0)
    for(i=0;i<opln;i++)
    this.expops[this.expops.length]=this.options[i];boo=true;
    else
    for(i=0;i<opln;i++)
    opart=this.options[i].text.toLowerCase().substring(0,alen)
    if(astr==opart)
    this.expops[this.expops.length]=this.options[i];boo=true;
    if(!boo){this.expops[0]=new ComboBoxItem("(No matches)","")}
    function ComboBox_remove(index)
    this.options.remove(index)
    function ComboBox_add()
    var i,arglen;
    arglen=arguments.length
    for(i=0;i<arglen;i++)
    this.options[this.options.length]=arguments[i]
    function ComboBox_build(arr)
    var str,arrlen
    arrlen=arr.length;
    str = '<table class="combo-list-width" cellpadding=0 cellspacing=0>';
    var strs = new Array(arrlen);
    for(var i=0;i<arrlen;i++)
    strs[i] = '<tr>' +
                   '<td class="combo-item" onClick="'+this.name+'.choose(\''+arr[i].value+'\',\''+arr[i].text+'\');'+this.name+'.opslist.style.display=\'none\';"' +
                   'onMouseOver="this.className=\'combo-hilite\';" onMouseOut="this.className=\'combo-item\'" > '+arr[i].text+' </td>' +
                   '</tr>';
    str = str + strs.join("") + '</table>'
    if(this.opslist){this.view.removeChild(this.opslist);}
    this.opslist = document.createElement("DIV")
    this.opslist.innerHTML=str;
    this.opslist.style.display='none';
    this.opslist.className = "combo-list";
    this.opslist.onselectstart=returnFalse;
    this.view.appendChild(this.opslist);
    function ComboBox_toggle()
    if(this.opslist)
    if(this.opslist.style.display=="block")
    this.opslist.style.display="none"
    else
    this.update();
    this.build(this.options);
    this.view.style.zIndex = ++ComboBox.prototype.COMBOBOXZINDEX
    this.opslist.style.display="block"
    else
    this.update();
    this.build(this.options);
    this.view.style.zIndex = ++ComboBox.prototype.COMBOBOXZINDEX
    this.opslist.style.display="block"
    function ComboBox()
    if(arguments.length==0)
    self.status="ComboBox invalid - no name arg"
    this.name = arguments[0];
    this.par = arguments[1]||document.body
    this.view = document.createElement("DIV");
    this.view.style.position='absolute';
    this.options = new Array();
    this.expops = new Array();
    this.value = ""
    this.build = ComboBox_build
    this.make = ComboBox_make;
    this.choose = ComboBox_choose;
    this.add = ComboBox_add;
    this.toggle = ComboBox_toggle;
    this.update = ComboBox_update;
    this.remove = ComboBox_remove;
    this.make()
    this.txtview = this.view.childNodes[0]
    this.valcon = this.view.childNodes[1]
    this.par.appendChild(this.view)
    Global_combo_array[Global_combo_array.length]=this;
    if(Global_run_event_hook){ComboBox_init()}
    ComboBox.prototype.COMBOBOXZINDEX = 1000 //change this if you must
    function ComboBox_init()
         if (document.addEventListener) {
              document.addEventListener("keyup", ComboBox_handleKey, false );
              document.addEventListener("mousedown", ComboBox_mouseDown, false );
         else if (document.attachEvent) {
              document.attachEvent("onkeyup", function () { ComboBox_handleKey(window.event); } );
              document.attachEvent("onmousedown", function () { ComboBox_mouseDown(window.event); } );
    Global_run_event_hook = false;
    function returnFalse(){return false}
    function ComboBoxItem(text,value)
    this.text = text;
    this.value = value;
    document.write('<link rel="STYLESHEET" type="text/css" href="ComboBox.css">');
    If you would like me to post the code for the CSS, let me know.

  • Embedding JSP in Javascript - filtering newlines

    I'm embedding some JSP tags in a Javascript function.
    It's all working fine except that <html:options> insists on emitting
    a newline after each <option></option> that it generates. So I can't embedd this
    in a Javascript string.
    Can I make <html:options> not produce an newline after each <option></option> ?
    Can I make <html:options> add on a "\" javascript continuation after each <option></option>?
    Can I write a filter tag that I can embed the <html:options> tag in?
    Is there a standard tag that will do what I need?
    Thanks
    Message was edited by:
    jgc94131

    OK, I'm going to post the solution that I've used.
    First off the tag causing the problem is from the struts taglib.
    What I've ended up doing was to use the Jakarta Project: String Tag library,
    which in turn depends on the apache String Utils package.
    The solution looks like this:
    <script language=javascript>
    function foo () {
      document.getElementById("foobar").innerHTML = '<tr><td>\
        <html:select property="searchCategorySelectedOne" value="<%=  CatalogForm.getSearchCategorySelectedOne()%>">\
        <html:option key="CatalogForm.searchCategory.displayname" value=""/>\
        <str:replace replace="NL" with="" newlineToken="NL"><str:replace replace="CR" with="" carriageToken="CR"><html:options collection ="CategoriesHolderList" property="value" labelProperty="label" /></str:replace></str:replace></html:select>\
        <\td><\tr>';
    </script>This example has been simplified to give the gist of the solution, which is
    wrap the <html:options> tag with two calls to <str:replace>.
    Message was edited by:
    jgc94131

  • How to pass value from JSP to Javascript?

    I want to pass 2 integers to Javascript to do checking? How can I do that?

    Well, it is very simple, Follow these steps.
    1. Have a form with fields
    2. On submit validate the form using javascript
    3. If the javascript returns false do not submit the form
    4. if the javascript returns true submit the form
    5. The destination jsp page will handle the db operations.
    1. <form name="frm1" action="dbcheck.jsp">
    <input type="text" name="txt1">
    <input type="button" value="submit" onClick="return validate();">
    </form>
    put the above piece of code in the <body> tag
    2. Upon submit the js function validate() will be called :
    <script language="javascript">
    function validate() {
    if(document.frm1.txt1.value="") {
    alert("enter text");
    return false;
    else {
    document.frm1.submit(); // i am not sure whether the () after submit is required or not
    put the above piece of code in the <head> tag.
    3. Now when the submit happens, the control goes to the dbcheck.jsp
    this is dbcheck.jsp:
    <%
    String str = (String) request.getParameter("txt1");
    ------other db operations go here --------
    %>
    "txt1" is the field name of the textbox from the form u previously submitted.
    all da best

  • Set jsp from javascript

    I have three "div" tags in index.jsp ,
    <div id='header'></div>
    <div id='body'></div>
    <div id='footer'></div>
    Now when window is loaded i want other jsp page to be set in the "body" div tag of index.jsp from javascript
    My javascript code
    function invokeJSP(){
    document.getElementById('body').innerHTML="<jsp:include page='test.jsp'>'";
    when I am including this code in <head > part of index.jsp its working the problem is if at all
    In test.jsp
    if i try to include this line
    <% = request.getParameter("name")%>
    its giving an error like "unterminated literal string" in javascript console
    Can anyone help me how to set the jsp from javascript
    Sorry for my bad english.This is the first time I am posting the forum
    thanks
    hema

    hi
    Thanks for the response
    but i have closed the tag in my program. Have u ever tried to invoke jsp from javascript in this way if it works plz help me.
    thanks hema

  • HTMLbeforeForm= SCRIPT LANGUAGE="JavaScript" window.opener = top; /SCRIPT

    I've found this line of code in my formsweb.cfg file, but to be honest I have no clue what it's doing.
    HTMLbeforeForm=<SCRIPT LANGUAGE="JavaScript">window.opener = top;</SCRIPT>
    Anyone know what this code might be responsible for?

    I have seen this sometimes used to prevent the user being asked if they want to close the window when a javascript command to close the window is issued. Not sure it always works with different browsers or versions.

  • Jsp in javascript

    hi
    can we use jsp in javascript
    for eg:
    <script>
    if(flag)
    <% respone.sendRedirect("--"); %>
    </script>
    or is there any other way of doing this type of things
    this is only an example.
    thx
    -jay

    You can use JavaScript in a JSP. JavaScript usually runs on client. You can also use Java in a JSP. Here is sample code:
    <%@ page import="java.util.*" %>
    <%
    Calendar cal = Calendar.getInstance();
         int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
         int hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
         int minuteOfHour = cal.get(Calendar.MINUTE);
         if (((dayOfWeek == 7) & (hourOfDay == 23) & (minuteOfHour > 29)) || ((dayOfWeek == 1) & (hourOfDay == 0) & (minuteOfHour < 31))) { %>  
    <jsp:forward page="file:///M:/Studio/projects/som/html/IC_0019.htm" />
    <% } %>

  • Make a dynamic menu using JSP or Javascript

    Hi ,
    I am trying to make a dynamic menu that is using data retrieved from database in the form of a list.
    I have a javascript to make a tree structure menu, but i need to iterate through the list i am reciveing from the database to make the tree structure. here is the code :-
    <Please reply ASAP as my deadline is near>
    <Note:- in javascript to make static menu ul tag is used to make the parent node and li tag is use to make the child node>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript" SRC="mktree.js"></SCRIPT>
    <LINK REL="stylesheet" HREF="mktree.css">
    </head>
    <body>
    <%@ page import = "java.util.ArrayList, java.util.Iterator, java.util.List, \WEB-INF\classes\DO_JSP.class,
    \WEB-INF\classes\Url_Name.class, java.util.Comparator, java.util.TreeSet, \WEB-INF\classes\MyComp.class" %>
    <%
         class Url_Name {
         String linkName;
         String linkUrl;
         int order;
         * @return the order
         public int getOrder() {
              return order;
         * @param order the order to set
         public void setOrder(int order) {
              this.order = order;
         * @return the linkName
         public String getLinkName() {
              return linkName;
         * @param linkName the linkName to set
         public void setLinkName(String linkName) {
              this.linkName = linkName;
         * @return the linkUrl
         public String getLinkUrl() {
              return linkUrl;
         * @param linkUrl the linkUrl to set
         public void setLinkUrl(String linkUrl) {
              this.linkUrl = linkUrl;
    class MyComp implements Comparator{
         public int compare(Object a, Object b){
              return (((Url_Name)a).getOrder() - ((Url_Name)b).getOrder());
         class DO_JSP
         int parentId;
         String parentName;
         TreeSet linkList;
         Url_Name tempurl;
         * @return the linkList
         DO_JSP(){
              linkList = new TreeSet(new MyComp());
         public TreeSet getLinkList() {
              return linkList;
         * @param linkList the linkList to set
         public void setLinkList(String linkName, String linkUrl, int order) {
              tempurl = new Url_Name();
              tempurl.setLinkName(linkName);
              tempurl.setLinkUrl(linkUrl);
              tempurl.setOrder(order);
              this.linkList.add(tempurl);
         * @return the parentName
         public String getParentName() {
              return parentName;
         * @param parentName the parentName to set
         public void setParentName(String parentName) {
              this.parentName = parentName;
         * @return the parentId
         public int getParentId() {
              return parentId;
         * @param parentId the parentId to set
         public void setParentId(int parentId) {
              this.parentId = parentId;
    %>
    <%
              List listdojsp =new ArrayList();
              listdojsp = (List)session.getAttribute("JspListName");
              Iterator it = listdojsp.iterator();
              do
    %>
              <%
              DO_JSP tempdojsp = (DO_JSP)it.next();
              String Parent = tempdojsp.getParentName();
              %>
              <ul class="mktree">     
              <li> Parent </li>
                   <ul>
              <%
              Iterator ittemp = tempdojsp.getLinkList().iterator();
                   do
                        Url_Name tempurlname = new Url_Name();
                        tempurlname = (Url_Name)ittemp.next();
                        String link = tempurlname.getLinkName();
              %>
                        <li>link</li>
              <%
                   }while(ittemp.hasNext());
              %>
                   </ul>
                   </ul>          
              <%     
              }while(it.hasNext());
              %>
    </body>
    </html>

    Hi ,
    I am trying to make a dynamic menu that is using data
    retrieved from database in the form of a list.
    I have a javascript to make a tree structure menu,
    but i need to iterate through the list i am reciveing
    from the database to make the tree structure. here is
    the code :- Hi, do you have a question? This is more of a "Look what I wrote" sort of post, and you don't seem to be asking for any specific advice. Please tell us what problem you're having, or the error message you're receiving.
    Brian

  • Language=Javascript" CODEPAGE

    The first line of code automatically generated for two
    templates is <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
    This line of code appears at the top of a browser window in
    FF and ME7.
    One of the templates has a spry popup menu and the other has
    a PVII menu magic menu. If I delete the first line of code the page
    still works without it. What is this code and is it necessary?
    Thanks, Dave

    DSWalther wrote:
    > The first line of code automatically generated for two
    templates is
    > <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
    I can't tell you *why* it's there, but it's the ASP way of
    saying "this
    page uses JavaScript and UTF-8 encoding.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • %@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%

    I can't figure out why <%@LANGUAGE="JAVASCRIPT"
    CODEPAGE="65001"%> is shown at the top of the page in Firefox.
    Safari works perfectly.
    The page is:
    http://www.boogieboarder.org/movies/
    Any tips would be a great help. Thanks.

    When you created this page in DW you specified that it would
    be an
    ASP/Javascript page.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "mtpeders" <[email protected]> wrote in
    message
    news:fpv6mn$mqc$[email protected]..
    >I can't figure out why <%@LANGUAGE="JAVASCRIPT"
    CODEPAGE="65001"%> is shown
    >at
    > the top of the page in Firefox. Safari works perfectly.
    >
    > The page is:
    http://www.boogieboarder.org/movies/
    >
    > Any tips would be a great help. Thanks.
    >

Maybe you are looking for

  • Purchasing reports

    Hi Friends, Can anybody tell me,  is there any standard report in SAP to know how much is the local purchases / imported purchases made in the given period. Thanks & Regards, NR

  • End User Guide and Clone issues

    Hi, I am a newbie apps dba and would like to which docs/books to refer to know how the end user's work in EBS like how they place an order,etc. And also, I have done my clone a day back but the user's complain it is slow. I submitted a CP, it was com

  • WLST script for changing password for userid in Weblogic 9.2

    Hello Everyone, We want to change password for userid in weblogic 9.2. Is there a way we can do this by using WLST script? If so please provide me with steps for doing that using WLST. Thanks in advance. - - Weblogic Consultant

  • Passing data to IP address and PORT???

    Hi, I am trying to do a scenario, where in I need to make a synchronous call to a IP address and Port. The scenarion is SAP--> XI --> IP address/Port. Has anyone done this scenario, wherin you pass the string of data to a IP address and port? Regards

  • Premiere Elements 12 Silent Install

    Hello, we are trying to deploy Premiere Elements 12 silently. We have followed the instructions for Premiere Elements 10. We created the Application Override file (apllication.xml.override) with the following lines <?xml version="1.0" encoding="utf-8