Sending and parse javascript object variable to java variable

can anyone help me how to send and parse javascript object variable from client to java variable on servlet. Here is what i mention about:
suppose i have object variable var_js with it's properties:
<script>
var var_js = {
id: 'var_js1',
name: 'this is var javascript',
allow_value_type: ['int', 'string', 'object']
</script>
/* after processing javascript object to java var, that i hope you guys may help me, it's java var (var_java) become something like*/
var_java.id = "var_js1";
var_java.name = "this is var javascript";
var_java.allow_value_type = {"int", "string", "object"}

You could have this html page:
<html>
<script>
var var_js = {
id: 'var_js1',
name: 'this is var javascript',
allow_value_type: ['int', 'string', 'object']
function send()
document.getElementById("id").value = var_js.id;
document.getElementById("name").value =var_js.name;
document.getElementById("allow_value_type").value =var_js.allow_value_type;
document.form.submit();
</script>
<form name="myForm" action="http://localhost:8080/servlet/myServlet" method="post" >
<input id="id" type="hidden" value="">
<input id="name" type="hidden" value="">
<input id="allow_value_type" type="hidden" value="">
<input id="cmdGo" type="button" value="Button" onClick="send()">
</form>
</html>
Then have a servlet like this:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class myServlet extends HttpServlet {
public void doPost( HttpServletRequest request,
HttpServletResponse response )
throws ServletException, IOException
String id = request.getParameter("id");
String name = request.getParameter("name");
String allowed_value_type = request.getParameter("allowed_value_type");
Var_java var_java = new Var_java(id,name,allowed_value_type);
//and have you java object
class Var_java
String id;
String name;
String allowed_value_type;
public var_java(String id,String name,String allowed_value_type)
this.id=id;
this.name=name;
this.allowed_value_type=allowed_value_type;
well...something like that i think.
Hope it helps.

Similar Messages

  • Assigning javascript variables to java variables in JSP

    Does anyone know if it possible to assign a javascript value to a java variable in a javascript function? I want to be able to use the javascript value in a PreparedStatement call, but I can't assign the value of the javascript variable to a java variable. I know the opposite can be done using hidden variables in the form, but I need:
    javascript -> java variable in a JSP scriptlet.
    Any help would be much appreciated,
    Thanks,
    -Dave

    Can't do that.
    html/javascript is in the client side.
    jsp is in the server side.
    In order to put html/javascript values (client side) into jsp (server side) it must be submitted.
    Try remoting. Using an iframe with a jsp as the source of it and the html target pointing at it.
    -------------

  • Assigning javascript varibel value to java variable

    Hi all
    I want to find screen resolution in one jsp page.That can be done in javascript.
    (though 'screen.width and screen.height')
    But is there any way to assign that value to java variable.
    Any body has the idea?
    Help me.

    No, why ? becuase jsp is SERVER side
    There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that

  • Assigning javascript varible value to java variable

    Hi all
    I want to find screen resolution in one jsp page.That can be done in javascript.
    (though 'screen.width and screen.height')
    But is there any way to assign that value to java variable.
    Any body has the idea?
    Help me.

    No, why ? becuase jsp is SERVER side
    There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that

  • Create and bind javafx objects out of java

    hello,
    iam start to learn javafx and cant find the right way to do what i want.
    the goal is: i have written a graph datastructure in java and want to parse a xml file. for every String in the xml file a new node in the graph should be created. this node holds the data and a position (2D). now evertime a node in the graph was created, a visual representation for this node should pop out in my javafx stage. when the position of the node changed the visual rep. should notice this or rather a function on this object is called (observer).
    is javafx an approach to do so? or should i use java2d?
    do you know a tutorial where i can learn how to create an call javafx objects out of java and how to put them into the stage/scene?
    i found this: http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/index.html
    but there is not mentioned how to put the object into the stage/scene.
    regards
    peter

    thanks. this is also a good article. [http://blogs.sun.com/michaelheinrichs/entry/binding_java_objects_in_javafx|http://blogs.sun.com/michaelheinrichs/entry/binding_java_objects_in_javafx]
    Edited by: iam_peter on May 23, 2009 4:49 AM

  • Assigning javascript variable to java variable??

    I'm working on a web app, and part of it is form to add/update customers information. What my problem is I have all the cities of the US and Canada in a database and was using javascript to load the cities depending on which province/state is selected from another list box. Because the database is so large it takes a long time and everytime the page loads it takes a long time because the java code runs. The cities are loaded into the page by a javabean which returns a vector with all of the cities. What I want to do is use the province or state id to pass to the bean and just retreive the cites for that state as oppose to loading all of them. However, I'm stuck with assigning that value from my list box, which I would use javascript to determine, then passing it as a parameter to the bean.
    From the research I did, it seems like it can't be done. I'm seeking some advice thoough, as there would be someone who had this problem before and solved it or found a work around. Would be grateful for any help and advice. below is a part of my code that's presenting the obstacle.
    <script type="text/javascript">
    <!--
    function fillCityList()
         var num=document.mDetails.provinceId.options[document.mDetails.provinceId.selectedIndex].value
         var boxlength=0
         document.mDetails.cityId.options.length = 0     
         <%     
         for ( int ctr=0;ctr<cityList.size();ctr++)
              City aCity = (City) cityList.elementAt(ctr); %>     
              if(num==<%= aCity.getProvinceId() %>)
                        document.mDetails.cityId.options[document.mDetails.cityId.options.length]=new Option("<%= aCity.getCityName() %>", "<%= aCity.getCityId() %>");     
         <% } %>           
    // -->
    </script>
    </html>

    How about doing this:
    <html>
    <head>
    <script language="JavaScript">
    vfnStateChange = function() {
         var oState = document.forms['myform'].state;
         var sState = oState.options[oState.selectedIndex].value;
         document.location.href='thispage.jsp?state=' + sState;
    </script>
    </head>
    <body>
    <form name="myform" action="somepage.jsp">
    <select name="state" onchange="vfnStateChange();">
    <%
    ArrayList stateList = somebean.getStates();
    for(int i = 0; i < stateList.size(); ctr++) {
         State s = (State)stateList.elementAt(i);
    %>
    <option value="<%= s.getStateId() %>"><%= s.getStateName() %></option>
    <% } %>
    </select>
    <select name="city">
    <%
    String state = request.getParameter("state");
    if(state == null) {
    %>
    <option value=""></option>
    <%
    } else {
         ArrayList cityList = somebean.getCities(state);
         for(int i = 0; i < cityList.size(); i++) {
              City c = (City)cityList.elementAt(i);
    %>
    <option value="<%= c.getCityId() %>" <%= c.getStateId().equals(state) ? "" : "selected=\"selected\"" %>><%= c.getCityName() %></option>
    <%
    %>
    </select>
    </form>
    </body>
    </html>

  • Passving javascript variable Values to java variable

    I need help from anywone please.
    I created a SELECT object on a jsp. I want to retrive the highlighted element in the list and put this value in a java variable so that I can send the value to another page. How can I achieve this please?

    Alaafiatayo wrote:
    I created a SELECT object on a jsp. I want to retrive the highlighted element in the list and put this value in a java variable so that I can send the value to another page. How can I achieve this please?Your terminology is fairly confusing. Please align the right terminology for yourself.
    As far I understand you want to get the currently selected value of a HTML dropdown element in the server side? Just submit the form to the server and use request.getParameter("nameOfInputElement") where "nameOfInputElement" is the same as <select name="thisName">.
    This is covered by every decent JSP/Servlet tutorial. I recommend you to go through it first before asking this kind of basic questions.

  • Assign a value to an ODI or Java variable in a KM

    Hi Gurus,
    I'm developing a new KM and I need to get the name of a dblink by calling an Oracle function. How to store the result of a function in an ODI or Java variable in a KM step ?
    And if it is in an Java variable, how to use it in this kind of step (line 7) :
    create or replace view <%=odiRef.getObjectNameDefaultPSchema("L", "" , "W")%><%=odiRef.getInfo("COLL_NAME")%>
         <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "", "")%>
    as select     <%=odiRef.getPop("DISTINCT_ROWS")%>
         <%=odiRef.getColList("", "[EXPRESSION]", ",\n\t", "", "")%>
    from     <%=odiRef.getSrcTablesList("", "[SCHEMA].[RES_NAME]@"+++*#PROJECT.VARIABLE*+++" [POP_TAB_ALIAS]", ", ", "")%>
    where     (1=1)
    <%=odiRef.getFilter()%>
    <%=odiRef.getJrnFilter()%>
    <%=odiRef.getJoin()%>
    <%=odiRef.getGrpBy()%>
    <%=odiRef.getHaving()%>
    Thanks a lot for your help.
    Best regards

    If it is java variable then your code should looks like this
    create or replace view <%=odiRef.getObjectNameDefaultPSchema("L", "" , "W")%><%=odiRef.getInfo("COLL_NAME")%>
    <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "", "")%>
    as select     <%=odiRef.getPop("DISTINCT_ROWS")%>
    <%=odiRef.getColList("", "[EXPRESSION]", ",\n\t", "", "")%>
    from     <%=odiRef.getSrcTablesList("", "[SCHEMA].[RES_NAME]@ *<@=java_variable_name@>* [POP_TAB_ALIAS]", ", ", "")%>
    where     (1=1)
    <%=odiRef.getFilter()%>
    <%=odiRef.getJrnFilter()%>
    <%=odiRef.getJoin()%>
    <%=odiRef.getGrpBy()%>
    <%=odiRef.getHaving()%>
    If it is odi variable then your code should looks like this
    create or replace view <%=odiRef.getObjectNameDefaultPSchema("L", "" , "W")%><%=odiRef.getInfo("COLL_NAME")%>
    <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "", "")%>
    as select     <%=odiRef.getPop("DISTINCT_ROWS")%>
    <%=odiRef.getColList("", "[EXPRESSION]", ",\n\t", "", "")%>
    from     <%=odiRef.getSrcTablesList("", "[SCHEMA].[RES_NAME]@ *#odi_variable_name* [POP_TAB_ALIAS]", ", ", "")%>
    where     (1=1)
    <%=odiRef.getFilter()%>
    <%=odiRef.getJrnFilter()%>
    <%=odiRef.getJoin()%>
    <%=odiRef.getGrpBy()%>
    <%=odiRef.getHaving()%>

  • How to manipulate a javascript object in java?

    Hi, I am fiddling with the java scripting interface. As I understand the rhino engine is packaged with the jdk but what I don't understand is how does one reconcile the objects one gets from their engine (e.g. sun.org.mozilla.javascript.internal.ScriptableObject) versus the ones in the rhino api (e.g. org.mozilla.javascript.ScriptableObject)?
    Is the one in the jdk heavily modified or wrappered up to suit their javax.scripting interface?
    More specifically, how do I manipulate javascript objects from java?
    e.g. suppose I have this java code:
    ScriptEngineManager mgr = new ScriptEngineManager();
    ScriptEngine js = mgr.getEngineByName("js");
    jsEngine.eval("var foo = { x : 1, y : 'hello', z : false };");
    Object o = jsEngine.get("foo");Now o is instanceof sun.org.mozilla.javascript.internal.NativeObject, which is a subclass of a bunch of other classes in the s.o.m.j.i namespace. Being internal I can't use these directly.
    Looking at the Rhino API obviously you normally get a org.mozilla.javascript.ScriptableObject and can call the .get() .getIds() methods. But I don't know how to translate the objects I am getting in my actual java code which uses the jdk engine into org.mozilla.javascript objects.
    Is this even possible? Am I misunderstanding something completely? Should I just be using the rhino js jar and not the javax.scripting interface? If so, for what reason is the javax.scripting interface implemented?

    Assuming that you DO want a deep copy, begin with a constructor that takes another hand.
    public Hand( Hand h ) { ...Then for each instance variable, within that constructor:
    this.instVar0 = h.instVar0;
    this.instVar1 = h.instVar1;
    . . .And last, for every reference, make sure there is a constructor (or copy method for arrays) that itself makes a deep copy:
    this.ref0 = new Ref0Type( h.ref0 );

  • While trying to invoke the method java.lang.String.length() of an object loaded from local variable 'payload'

    Hi,
    Our PI is getting data from WebSphere MQ and pushing to SAP. So our sender CC is JMS and receiver is Proxy. Our PI version is 7.31.
    Our connectivity between the MQ is success but getting the following error while trying to read the payload.
    Text: TxManagerFilter received an error:
    [EXCEPTION]
    java.lang.NullPointerException: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'payload'
           at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:73)
           at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:204)
           at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:348)
           at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:204)
    I have searched SDN but couldn't fix it. Please provide your suggestion.
    With Regards
    Amarnath M

    Hi Amarnath,
    Where exactly you are getting this error?
    If you are getting at JMS Sender communication channel, try to stop and start the JMS communication channel and see the status, also use XPI Inspector to get the exact error log.
    for reference follow below blogs:
    Michal's PI tips: ActiveMQ - JMS - topics with SAP PI 7.3
    Michal's PI tips: XPI inspector - help OSS and yourself
    XPI Inspector

  • Setting the value of a java variable in javascript function

    How can i set the value of a java variable in a javascript function?
    <%
    String fName = "";
    %>
    now i want to define a javascript function which can set the value of fName to the value it has been passed.
    <script language="javascript">
    function setJValue(val)
    </script>
    Thanks

    The only way you could simulate this, would be call the same page inside the Javascript function, and send it the parameter that was passed. Then you would have your Java code retrieve this parameter by request.getParameter("value");, and set the variable accordingly.

  • Approval task SP09: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'

    Hi everyone,
    I just installed SP09 and i was testing the solution. And I found a problem with the approvals tasks.
    I configured a simple ROLE approval task for validate add event. And when the runtime executes the task, the dispatcher log shows a error:
    ERROR: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'
    And the notifications configured on approval task does not start either.
    The approval goes to the ToDO tab of the approver, but when approved, also the ROLE stays in "Pending" State.
    I downgraded the Runtime components to SP08 to test, and the approvals tasks works correctly.
    Has anyone passed trough this situation in SP09?
    I think there is an issue with the runtime components delivered with this initial package of SP09.
    Suggestions?

    Hi Kelvin,2016081
    The issue is caused by a program error in the Dispatcher component. A fix will be provided in Identity Management SP9 Patch 2 for the Runtime component. I expect the patch will be delivered within a week or two.
    For more info about the issue and the patch please refer to SAPNote 2016081.
    @Michael Penn - I might be able to assist if you provide the ticket number
    Cheers,
    Kristiyan
    IdM Development

  • Passing a variable from Javascript to java variable in a JSP.

    Here is simple test Ive been messing around with.
    How do I assign the value that was selected in the radio button to a java variable in my JSP here. Javascript being client side and JSPs being serverside makes this difficult.
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    function valbutton(thisform)
         myOption = -1;
         for (i=0; i<thisform.myradiobutton.length; i++)
              if (thisform.myradiobutton.checked)
                   myOption = i;
         if (myOption == -1)
              alert("You must select a radio button");
              return false;
         alert("You selected button number " + myOption + " which has a value of " + thisform.myradiobutton[myOption].value);
         thisform.submit();
    </SCRIPT>
    <title>CreateCategoryContent</title>
    </head>
    <body>
    <BR>
    <center>
    <%
         for(int i = 0; i < 10; i++)
    %>
    <form name="myform">
    <table border="1" bordercolor="#C0C0C0" width="50%" cellpadding="0" cellspacing="0" bgcolor="white">
         <tr>
         <td><%=i%><input type="radio" VALUE="<%=i%>" name="myradiobutton"></td>
         </tr>
    <%
    %>
    </form>
    <input type="submit" name="submitit" onclick="valbutton(myform);return false;" value="Validate" />
    </table>
    </center>
    <!--//T2-->
    </body>
    </html>
    Thanks dudes.

    Please excuse me for appearing dim but my JSP skills are rather weak.
    I dynamically create rows in a table from an Iterator. If the mainTopic is news then I need a third column to appear with radio buttons. I have all this done. When a radio button is selected and the UPLOAD button is selected I need to know which of the values in the table was selected.
    When I ran the test below the selected value was null. Can you help me?
    Thanks.
    <%@ page session="false" %>
    // imports etc
    <%@ page errorPage="../com/digisoft/common/Error.jsp" %>
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    function valbutton(thisform)
         myOption = -1;
         for (i=0; i<thisform.myradiobutton.length; i++)
              if (thisform.myradiobutton.checked)
                   myOption = i;
         if (myOption == -1)
              alert("You must select a radio button");
              return false;
         alert("You selected button number " + myOption + " which has a value of " + thisform.myradiobutton[myOption].value);
    thisform.selected.value=thisform.myradiobutton[myOption].value;
         thisform.submit();
    </SCRIPT>
    <title>CreateCategoryContent</title>
    <LINK REL="stylesheet" HREF="<%=request.getContextPath() + "/stylesheets/digihostnews.css"%>" TYPE="text/css">
    <%
    HttpSession session = request.getSession(false);
    String mainTopic = request.getParameter("mainTopic");
    String subCategory = request.getParameter("subCategory");
    String subCategoryId = request.getParameter("subCategoryId");
    String subCategoryToBeDeleted = request.getParameter("subCategoryToBeDeleted");
    String selection = request.getParameter("selection");
    // other initializations etc
    %>
    </head>
    <body>
    <BR>
    <!--Another table-->
    <center>
    <table border="1" bordercolor="#C0C0C0" width="90%" cellpadding="0" cellspacing="0" bgcolor="white">
         <tr>
              <td class="blue">Select Topic</td>
         </tr>
         <tr>
         <td class="insidebox2">
         <BR>
              <form action="NewsUpdate.jsp" method=post>
              Select Topic
              <select NAME="mainTopic" class="dropdown">
              <%
                   Iterator menuItems = myLombardiaMgr.getMainCategories();
                   while(menuItems.hasNext())
                        MainCategory aMenuItemCategory = (MainCategory)menuItems.next();
                        String menuItem = aMenuItemCategory.getMainCategory();     
                        if(!menuItem.equalsIgnoreCase(mainTopic))
              %>
                        <option VALUE="<%= menuItem %>" ><%= menuItem %></option>
              <%
                        else
              %>
                        <option SELECTED VALUE="<%= menuItem %>" ><%= menuItem %></option>
              <%
              %>
         </select>
         <INPUT type=submit class="newsbutton" value="LOAD" name=Submit>
    </form>
    <form action="AddCategoryDescription.jsp" method=post>
    <INPUT TYPE=HIDDEN NAME="mainTopic" VALUE="<%=mainTopic%>">
    <INPUT type=submit class="newsbuttonlong" value="EDIT DESCRIPTION" name=Submit>
    </form>
    </td>
    </tr>
    </table>
    </center>
    <!--//Another table-->
    <!--T2-->
    <center>
    <table border="1" bordercolor="#C0C0C0" width="90%" cellpadding="0" cellspacing="0" bgcolor="white">
         <tr><td class="blue">Categories</td></tr>
         <tr>
              <td class="insidebox2">
              <BR>
              <form action="NewsUpdate.jsp" method=post>
                   Add Category
                   <input type="text" name="subCategory" class="dropdown" id="catId" value=""/>
                   <INPUT TYPE=HIDDEN NAME="mainTopic" VALUE="<%=mainTopic%>">
                   <%      
                   if (mainTopic != null)
                        %>
                        <INPUT type=submit class="newsbutton" value="ADD" name=Submit>
                   <%
                   else
              %>
                   <INPUT type=submit class="newsbutton" value="ADD" name=Submit disabled>
                   <%
                   %>
              </form>
                   <!--T3-->
         <table id="categoryTable" border="1" bordercolor="#035C98" width="60%" height="60%" cellpadding="0" cellspacing="0" bgcolor="white">
         <tr>
         <td colspan="1" class="result"><b>Category Name</b></td>
         <td colspan="1" class="result"><b></b></td>
         </tr>
    <%
              if(myApplicationDetails != null)
                   myApplicationDetails = myLombardiaMgr.getAllApplicationDetails();
                   Iterator myMainCategories = myApplicationDetails.getMainCategories();
              while(myMainCategories.hasNext())
                   MainCategory aMainCategory = (MainCategory) myMainCategories.next();
                   if(aMainCategory.getMainCategory().equalsIgnoreCase(mainTopic))
                        Iterator subTopics = aMainCategory.getSubTopics();
                        while(subTopics.hasNext())
                             SubTopic aSubTopic = (SubTopic) subTopics.next();
                   %>
                        <form action="NewsUpdate.jsp" method=post>
                             <tr>
                             <td class="result"><%=aSubTopic%></td>
                             <td class="result">
                                  <INPUT type=submit class="newsbutton" value="REMOVE" name=Submit>
                                  <INPUT TYPE=HIDDEN NAME="subCategoryId" VALUE="<%=aSubTopic.getId()%>">
                                  <INPUT TYPE=HIDDEN NAME="subCategoryToBeDeleted" VALUE="<%=aSubTopic%>">
                                  <INPUT TYPE=HIDDEN NAME="mainTopic" VALUE="<%=mainTopic%>">
                                  <INPUT TYPE=HIDDEN NAME="subCategory" VALUE="<%=aSubTopic%>">
                             </form>
                        <form action="EditStoryItem.jsp" method=post>
                             <INPUT TYPE=HIDDEN NAME="subCategory" VALUE="<%=aSubTopic%>">
                                  <INPUT TYPE=HIDDEN NAME="subCategoryId" VALUE="<%=aSubTopic.getId()%>">
                                  <INPUT TYPE=HIDDEN NAME="mainTopic" VALUE="<%=mainTopic%>">
                                  <INPUT type=submit class="newsbutton" value="EDIT" name=Submit>
                             </form>
                             <%
                                  if(mainTopic.equalsIgnoreCase("News"))
                             %>
                                  <td class="result">
                                       <INPUT type="radio" name="newsitem" VALUE="<%=aSubTopic%>" >
                                       <INPUT TYPE=HIDDEN onclick="valbutton(myform);return false;" NAME="selection" >
                                  </td>
                             <%
                             %>
                   </td>
                             </DL>
                                  </tr>
                        <%
                             } // end of if
                        %>
         </table>
         <table border="0" bordercolor="#C0C0C0" width="60%" cellpadding="0" cellspacing="0" bgcolor="white">
         <tr><td align="right">
         <form action="../../../../../../servlet/UploadXmlFiles" method=post>
         <% if(myApplicationDetails == null )
         System.out.println("******************* selection "+selection);
    %>
              <INPUT type=submit class="newsbutton" value="UPLOAD" name=Submit disabled>
    <%
         else
    %>
    <INPUT type=submit class="newsbutton" value="UPLOAD" name=Submit>
    <%
         System.out.println("******************* selection "+selection);
    %>
         </form>
         </td>
         </tr>
         </table>
         <!--//T3-->
         </td>
         </tr>
    </table>
    </center>
    <!--//T2-->
    </body>
    </html>

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • Can not JavaScript objects in Java project

    Hi guys and girls,
    I have CMP managed java project that I am trying to create a menu for. Each time I create a new javascript object I am getting the error "objectname is undefined". Below is a code snipset followed by the error message I get when I try displaying the jsp.
    <head>
         <link rel="stylesheet" href="menu.css">     
         <script language="javascript" type="text/javascript" src='menu.js'></script>     
         <script language="javascript" type="text/javascript" src='menu_items.js'></script>     
         <script language="javascript" type="text/javascript" src='menu_tpl.js'></script>
    </head>
    <body leftmargin="15" rightmargin="15" marginheight="15" marginwidth="15" bgcolor="white">
    <script language="javascript">               
              new menu (MENU_ITEMS, MENU_POS);
         </script>     
    </body>
    The error message is 'menu' is undefined.
    I supspect that the src=menu.js reference is not working but I am not sure how I can change this. Any help would be appreciated.

    Hi guys and girls,
    I have CMP managed java project that I am trying to
    create a menu for. Each time I create a new javascript
    object I am getting the error "objectname is
    undefined". Below is a code snipset followed by the
    error message I get when I try displaying the jsp.
    <head>
    <link rel="stylesheet" href="menu.css">
    <script language="javascript" type="text/javascript"
    src='menu.js'></script>
    <script language="javascript" type="text/javascript"
    src='menu_items.js'></script>
    <script language="javascript" type="text/javascript"
    src='menu_tpl.js'></script>
    </head>
    <body leftmargin="15" rightmargin="15"
    marginheight="15" marginwidth="15" bgcolor="white">
    <script language="javascript">
    new menu (MENU_ITEMS, MENU_POS);
    </script>
    </body>
    The error message is 'menu' is undefined.
    I supspect that the src=menu.js reference is not
    working but I am not sure how I can change this. Any
    help would be appreciated.
    Hi
    I didn't get a clear picture of your question. Any way try this.
    1) make sure that menu.js is in the same directory as your jsp file. if it is not give the proper path.
    2) what is this MENU_ITEMS, and MENU_POS. instead of it try with integers

Maybe you are looking for

  • Can't connect to mail server - DNS Server settings?

    Hello: Let me preface this question by saying that computer networking is not my strong suit. Last week I moved our web hosting from our ISP to Lunarpages; our domain is marshall-arts.net. I set up some POP email accounts on our new mail servers and

  • Consignment Stock for Inventory Management

    Posting as a new thread... I have installed and loaded the Inventory Management Cube 0IC_03 in our development and quality systems.  During testing we have found just one problem with Consignment Stock.  The Stock Initialization (2LIS_03_BX) does not

  • Can't import multiclip from FCP

    I am trying to import a multiclip project from FCP and the file appears to process except it fails at the end and the error message says error processing. am I missing something other then my file? or is there a work around? thanks

  • Questions about Pre-amp of the Tascam FW1884 or M-Audio Project Mix...

    Hello everybody, I'd like to purchase a semi-pro (I hope) audio interface. The Tascam FW1884 or the M-Audio Project Mix with their "all in one" feature seem to fit for what I want to do. But I don't know if the Pre-amp or the digital converters are q

  • Opening Elements 7

    When I open Elements 7 I get a screen asking me to join Photoshop.com. I'm not interested in this right now and I'd like to go directly to the organizer as i was able to do in Elements 6. Is this possible?