Menu item in Jsp/Servlet

Hi experts, when you're using Jsp/Servlet to implement the front-end web application, what options do you have for implementing some menu dropdown?
Is awt or swing can be used for that purpose?
How would you go about the layout management issue?
Thanks, and your reponse is appreciated

I guess You are looking for a solution in JSP/Servlets. Here is my program that might be help ful to you. This program will bring a drop down list that fetches the values from the database.
<table cellpadding=4 cellspacing=2 border=0 align=center>
<TR>
<TD><B>choose Code</B></TD>
<TD valign=top>
<!-- this code is to generate the list of Codes-->
<% String userId =(String) session.getValue("userName"); %>
<%
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String uId;
String returnString="";
String null_value="";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@serverName:1521:localHost", "scott", "tiger");
if (con == null) {
System.out.println("Connection not found");
stmt = con.createStatement();
con.setAutoCommit(false);
String sql= "select code from example_list where user_id='"+userId+"'";
rs= stmt.executeQuery(sql);
%>
<select name="alcList">
<%String aString;
rs= stmt.executeQuery(sql);
while (rs.next()) {
%>
<option value="<%= aString = rs.getString("code") %>">
<%= aString %></option> <%}%></select><%
con.commit();
//returnString= true;
} catch(SQLException sqlex) {
sqlex.printStackTrace();
//return returnString;
} catch(Exception ex) {
ex.printStackTrace();
} finally {
stmt.close();
con.close();
stmt = null;
rs = null;
con = null;
%></TD>
<TD align=center>
<INPUT TYPE=submit SIZE=30 VALUE="Submit"></TD>
</TR>
</Table>
</FORM>
</BODY>
</HTML>if this doesn't answer your problem, Please post your question exactly. May be I can help you out.
Good Luck.
-Sreekanth varidhireddy

Similar Messages

  • How can i display data on tha same page in jsp/servlet

    Hello friend,
    I am storing 50 items in a dataBase. i ve two buttons/links name previous and next. i ve to display 10 items each time in the same page when i click next button and the revrese for previous. through JSP/Servlet.
    Any suggestions will be appreciated.
    chintan anand

    I'm not sure this is the best practice... try to add the item in the arraylist, then when u click next button, add 10 to the counter. subtract if it is a previous button. thats it!
    ex..
    for(int x=counter;x<=arraylist.lenght();x++)
    ....print item here......
    }

  • Problem when trying to add a link to the left menu item!!!!

    Hi everyone,
    I am trying to put a new menu group on the left menu,with a link in that group for every one.On checking with the customization guide this is what i did
    for one link i did add the following lines in each of the files
    1)xlWebAdmin.properties
    - menuGroup.Misc-Menu=Misc Menu
    - menuItem.Misc-Menu.My-Nomination=My Nomination
    2) xlDefaultAdmin.properties
    - menuItem.Misc-Menu.My-Nomination.link=mynomineefrm?showfrm
    3) repacked the war and the ear
    4) Restarted my server
    When I login into the administration(xelsysadm) page I didnt see any menu item with name "My Nomination" which i am supposed to see.
    secondly it shows the menu item when ever i select some group and click on assign menu item.
    Moreover, when I try to assign this menu item to all users group it gives me this error
    On browser it prints
    Permission Denied to Assign Selected Menu Items
    You do not have the permissions to assign one or more selected menu items.
    on console it prints
    ERROR [SERVER] Class/Method: tcDataObj/eventPreInsert Error :Insert
    permission is denied
    ERROR [APIS] Class/Method: tcGroupOperationsBean/addMenuItems encou
    nter some problems: maoRejections:You do not have permission to insert this obje
    ct.
    ERROR [APIS] Class/Method: tcGroupOperationsBean/addMenuItems encou
    nter some problems: Error occurred while adding menu items.
    ERROR [WEBAPP] Class/Method: UserGroupMenuItemsAction/commitGroupAs
    signMenuItems encounter some problems: {1}
    Thor.API.Exceptions.tcBulkException
    This problem eat my happy sunday :-(, any one has solution for this problem?
    - Also if some one can help on how to link jsp to the new link will be helpful for me!
    Thanks,
    doki

    Design Console > Form Information > add new
    Class Name Organizations.Merge
    Description Move users from one organization to another
    Type menuitem
    Add following to xlWebAdmin.properties, xlWebAdmin_en_US.properties
    Organizations.Merge=mergeOrgs.do?Display
    menuItem.Organizations.Merge.link=mergeOrgs.do?MergeOrganizations
    menuItem.Organizations.Merge=Merge
    mergeOrgs.button.display=Merge Organizations
    Even you have to assign first to System Administrator group
    First go to Manage Group
    Select System Administrator Group
    Select Menu Item
    Click Assign and select newly craeted Menu Item and click Confirm
    These are the steps to see the new menu item. To make this menu item working:
    you'll have to write action class, form bean class and you'll have to create JSPs and make their entry in struts-config as welll as in Tiles-def.xml
    Then your menu item will work.

  • JSP/Servlets & XML - suggestion needed

    Hi everyone,
    I don't have any coding issues, I'm really just looking for some help on deciding how to go with a project I want to make. First off, I wrote a Java library that builds messages in a special format. I wanted to come up with a pretty frontend for it, so I decided I'd try my hand at a webapp since I've been interested in them for a while. So far my web app consists of jsps, servlets and my library.
    At this point I'd like to add the ability for the webapp to store created messages in an XML file (read / write). The XML library I want to use is JAXB. I have it setup to read/write my XML file fine in a test servlet, however I'd like to implement this in a kind of "best practice" approach. So I'm looking for suggestions on how I should do this.
    A few of my ideas:
    1) Use a jsp page to call a "MessagesBean" which retrieves my data from my xml file. I could then format this nicely in the jsp page. The problem with this however is that I can't find any way to open a file relative to the webapp from within a Bean. ie. when I try to open "messages.xml", I can see from tomcat errors that it attempts to open it in tomcats bin folder (or if i run from within eclipse, eclipses bin folder). I know I could get around this by using an absolute path but I want this to be portable. Any suggestions?
    2) To solve the above problem I found "getServletContext().getRealPath("")" in the Servlet API. Using this method I'm able to open my XML file relative to my webapp. The only issue I have here is that I'm now using a servlet to display the page, making it harder for me to format the output.
    I'm very new to JSP/Servlets/etc so I really don't know how I should be doing this. I'm just trying to make sure I don't start out on the wrong foot. Can someone please give some suggestions on what I could do?
    Cheers.

    I suggested not putting business logic in the servlet, but instead instansiating a business logic object in the servlet and calling one of its functions to do the work.
    There is nothing wrong with putting the business logic in the servlet on first try. Just later on, you might want to refactor the code to more conform to the above.
    In your code, you mentioned that the MessagesBean in the JSP page doesnt seem to call the constructor. The <useBean> tag first looks to
    see if the object is in request scope. If it is, it uses it (doesnt call constructor). If its not, it creates its own (calls constructor). You should always
    have it in request scope ready for useBean to use.
    I think this line:
    <jsp:useBean id="messages" class="my.package.MessagesBean" />
    should be changed to something like:
    <jsp:useBean id="messages" class="my.package.MessagesBean" scope="request" />
    The MessagesBean should only have get/set methods to get data out of its object (its a very simple object that holds data). None of its functions
    should perform business logic such as hitting the database.
    Therefore these items in your JSP page should be in the servlet or business logic:
    messages.setPath( getServletContext().getRealPath("") ); // Pass in relative PATH
    messages.processXML(); // Process XML file
    While this should be in your JSP:
    java.util.List<TEXT> TextFiles = messages.getTEXTFiles(); // Return a List of TEXT objects
    Question: The JSP calls my Bean "MessagesBean". It then passes in the current relative path. This seems fairly hackish to me, is there a better way to give the relative path to my bean?
    Answer: Hard code the relative path to the JSP page in the servlet or business logic. There is no need for the JSP page to pass its path back to the servlet or business logic. Your servlet
    'knows' the path to all the JSP pages it needs to dispatch to.
    The best way to learn MVC is to continually refactor your code until it looks more and more like MVC (separation of concerns).

  • Discoverer Plus/Viewer from menu item in Oracle Applications errors.

    Starting Discoverer Plus/Viewer from menu item in Oracle Applications R12 errors.
    Here is some general config information that is suspected to be the issue.
    1. Running Oracle Applications R12 over HTTPS.
    2. Running Discoverer Plus/Viewer over HTTP.
    3. Calling menu item that calls a function to start Plus/Viewer.
    Function Definition called by the menu item is listed blow.
    Properties Tab: Type=SSWA jsp function Context Dependence=Responsibility
    Form Tab: Parameters="mode=DISCO"
    Web HTML Tab: HTML Call=OracleOasis.jsp
    Fact: Starting Discoverer Plus using a URL works fine in the browser. The login page comes up and I can look in to Plus.
    The page that dose a redirection to start the Plus applet or Viewer web page fails with this error in IE 7.
    Internet Explorer cannot display the webpage
    Most likely causes:
    You are not connected to the Internet.
    The website is encountering problems.
    There might be a typing error in the address.
    Thank you for your time.

    Hi,
    Check that the ICX system profiles are set correctly for your Discoverer configuration. In particular the ICX: Discoverer Launcher and ICX: Discoverer Viewer Launcher system profiles.
    When IE displays an error is the URL displayed in the browser a correct Disco URL?
    Rod West

  • Sample jsp servlet bean (MVC) code

    We want to look into the JSP/Servlet/Bean area for our next project. We wish to understand the technology and as such want to hand build simple applications, and as such do not want to use JDeveloper just yet.
    We have searched and searched for suitable material but cannot anywhere find a sample application that :
    A. Lists contents of a databse table
    B. Each item in trhe list is a link to a page that allows that item, to be edited.
    C. A new item can be added.
    D. Uses the MVC model of JSP/Servlet and bean (preferably with no custom tags)
    There are examples that are too simplistic and do not cover the whole picture. Having spent over 100 GBP on books lately, only to be disappointed with the examples provided, we need to see some sample code.
    The samples provided by Oracle are too simplistic. They should really have provided ones built around the EMP and DEPT tables.
    Anyone know where we can get hold of this sample code.

    At the risk of sounding really dumb the examples are just too complex. There does not appear to be anywhere on the web where I can find a simple JSP/servlet/bean example of the type I described. There is enouigh material describing each individual component, but what I need is an example to cement the ideas, but the ones suggested are too much for a newbie. Even the much vaunted Pet Store thingy causes my eyes to glaze over.
    I dont expect anyone to have written something with my exact requirements, but surely to goodness there must be something that:
    1. On entry presents a search form on a table (e.g. EMP)
    2. On submission list all rows in EMp matchiung the criteria.
    3. The user can either click the link 'Edit' which opens up a form dispalying the row allowing the user to edit and save the changes, or click the 'New' button to show a blank form to create a new EMP.
    All this via a Controller servlet, with the database logic handled by a java bean, and all the presentation done via JSP.
    To me this is the most obvious and instructive example of this technology, but after days of trawling the web, and looking through a number of books, I cannot find such a thing.
    CGI with Perl DBI/DBD was a breeze to work with compared to this stuff ..... maybe ASP with SQL/Server would be a more fruitful use of time.

  • Missing Menu Items in Lens Correction Menu

    I shoot with a Canon 5Dmk3 and a standard EF 24-70 S f/2.8 lens. ACR finds the body and lens fine. When I go to Filter-> Lens Correction or Adaptive Wide Angle, I previously could select the Mk2 body and pick my lens. After a recent update, in CS6 on the mac or CC in windows, I can no longer pick a body. The only choice under camera model is 'Canon' and then there are only two Tamron lenses listed. I have tried the 'Search Online' button without success.I downloaded the 'Adobe Lens Profile Downloader' and downloaded the profiles for the mk2 with my lenses successfully. After doing so, no additional menu items have appeared in Photoshop.
    Is anyone else having this experience lately?

    Make sure your project includes the ADF Data Visualization tags under project properties->JSP Tag Libraries.

  • Why would menu items not display?

    I am trying to troubleshoot an issue a user is having with Bridge CS3. Several selections from his "Tools" menu have disappeard (not grey'd out, but actually missing). The one he's specifically looking for is the InDesign Contact Sheet command. He used to have them and now they are gone. I've compared my preferences with his and they are identical. He's running Tiger and I'm on Leopard.
    Here's another odd thing. My version is 2.1.1.9 and his is 2.1.0.100. Yet when I run Software updates and the Adobe updater on his computer, it reports back that everything is up-to-date. Even though our versions are different, as well as a different OSs, this doesn't explain why he used to have it and no longer does.
    Any thoughts?

    The 2.1.1 update can be downloaded from here - http://www.adobe.com/support/downloads/detail.jsp?ftpID=3813
    The InDesign menu item comes from a script loading at launch. You can look in the preferences> Startup Scripts and see if it is present but disabled.

  • The item "safari.jsp.download" can't be moved to the Trash because it can't

    I understand there is no way around the poor server quality issue, but I have received the following error when I visited a site and gotten an automatic download:
    The item “safari.jsp.download” can’t be moved to the Trash because it can’t be deleted.
    Is there a way around this. I hate the fact the icon is staying on my desktop. I can't move it to a folder, Applications, or the trash. Any thoughts?

    Hi,
    You need to quit Safari either from the Safari menu bar, Safari / Empty Cache or Command + Option + E on your keyboard.
    Move the file to the Trash. Now empty the Trash.
    Relaunch Safari.
    More insight to the .jsp file here.
    http://discussions.apple.com/thread.jspa?threadID=2727040
    Carolyn
    Message was edited by: Carolyn Samit

  • Render menu item conditionaly in contextMenu

    Hi,
    I am having a tree with contextmenu facet. Also, I have a "Actions" drop-down with the similar set of menu items in my toolbar. I use the same jsff for both the menus like this:
    1) for tree context-sensitive menu:
    <f:facet name="contextMenu">
    <af:popup id="popContextMenu"
    rendered="#{userCanEdit}"
    contentDelivery="lazyUncached">
    <f:subview id="contextView">
    <jsp:include page="/oracle/communications/brm/pdc/ui/fragments/changeset/changeSetContextMenu.jsff"/>
    </f:subview>
    </af:popup>
    </f:facet>
    2) For Actions dropdown:
    <af:menuBar id="mb1" rendered="#{userCanEdit}">
    <f:subview id="csMenuBar"
    binding="#{viewScope.workspaceBean.csMenuBar}">
    <jsp:include page="/oracle/communications/brm/pdc/ui/fragments/changeset/changeSetContextMenu.jsff"/>
    </f:subview>
    </af:menuBar>
    My use case is, I need to show "Create" menu item if menu is accessed using Actions drop-down. However, if user right clicks the tree node "Create" should not be displayed in context-sensitive menu. Any idea how can I distinguish the source of event, what should be the EL in "render" property of commandmenuitem?
    Regards,
    Afroz

    Hi John,
    I tried following:
    <f:subview id="csMenuBar" binding="#{viewScope.workspaceBean.csMenuBar}">
        <jsp:include page="/oracle/communications/brm/pdc/ui/fragments/changeset/changeSetContextMenu.jsff" flush="true">
                         <jsp:param name="isAction" value="true"/>
         </jsp:include>
      </f:subview>And in the included page I try to read this parameter using El : *#{param.isAction}*
    However, #{param.isAction} always returns blank. Looks like the parameter is not passed to the included page. Is there any other way to read this parameter?
    Regards,
    Afroz

  • Error while calling a form from another form's menu item

    I created a main form and menu module for this form.
    I am calling another form from main form menu item.
    i moved both the forms and menu and compiled them.
    But, when i run this form i am getting an error saying
    FRM 92100: Your connection to the server was interrupted
    This may be the result of a network error, or a failure on the server.
    You will need to establish your session.
    I set the seperateframe = true
    networkentries = 30
    But still getting the same error.
    Is there any parameter that i am missing.
    I will greatly appreciate if anybody can direct me to the solution.
    Thank you.
    Navya.

    Hi guest,
    the data definition is:
    DATA: XVBKD LIKE VBKDVB OCCURS 0 WITH HEADER LINE.
    the assignment:
    XVBKD-PRSDT = likp-erdat.
    Thanks,
    Hagit

  • How to reset input Text value on click of root menu item navigation link ?

    All,
    Jdeveloper - 11.1.1.6
    I am facing this issue across the pages.
    I have a root_menu.xml based navigation available as links at the top of ADF application. Some of the menu links directly have JSPX pages having the content being loaded , and others are JSPX containing Bounded task flow.
    Issue :
    On the click of the menu links, the page gets reloaded / refreshed , however the input value given on the page remains displayed even after refresh.
    We need the page refresh along with any input test box getting cleared on Menu item click.
    Any pointers as to how we can resolve.
    Thanks

    If your page is in a taskflow (which it should be as you use pageflowscope), you should have a method action in your task flow which you call to clear all the values you use in the UI.
    Timo

  • How to get all menu items list in blackberry curve phone

    Hai all
    i am new to Blackberry application developer. I done one application in blackberry in default simulaor, I changed my simulator to Blackberry 8900 simulator. The features is more in curve phones like instant messaging. So i need to get the full menu item list from the API. Do i neddd to change the API ?..  I wanted to get the list like .. camera,maps,contacts,messages,weblin,sms,instant messaging etc. Can anyone help me in this case. My intention to get all the menu items in a list.
    Thanks in Advance

    thank you for your solution.. my aim is list all the menu items in a drop down list. In the default simulator it is fetching all the menu items in the phone through API. But in curve 8900 it is not showing all the menu items, can u give me a suggestion
    like           ^
    camera
    contacts
    maps
    clock
    calendar  like this i need to display
    Message Edited by joedfranc on 05-30-2009 10:57 AM

  • Muse 2014 -sub menu items appearing on roll-over etc.

    Hi, complete newbie, so sorry if this has already been covered elsewhere. Only started using Muse about 1 month ago and now using Muse 2014 - using horizontal menu widget and discovered how it now shows sub-menus when hovering over the main menu item- I find this great!
    I want a 'Contact Me' page with a basic form and this is not a problem, however, I want the sub-menus to appear when hovering over the other main menu items, but not the contact me page - might be completely off here, but created a 'Thank you' page as a child page of the contact me page and only want this displayed (not as a sub-menu choice when hovering over the contact me main menu item) when they have clicked the submit button on the form (I know how to set this re-direction in the forms options). Have tried playing with menu on the master page - switching off the edit together and changing settings on only the contact me menu item - without success- seems to apply to all main menu items.
    I would like to know how to achieve sub-menus on other menu items - but not on contact me item;  or whether I am going about trying to have a 'Thank you' response when someone submits the contact me form in the completely wrong way - can this be better achieved by other means?
    I would really appreciate your advice and help. My published site is 'onyerbikegeordie.uk' with the main menus - except not with a contact me page as yet, but would  give you an idea of what I am trying to achieve except for a contact me page.
    Sorry for the long post, but thanks for reading and in anticipation of your help!
    Joe
    Message was edited by: Joe Fitzpatrick

    Hi, managed to find the answer to this myself. In Plan, right-click on page and select Menu Options > Exclude Page from Menus. Job Done!
    Joe

  • Implementing menu items and saving state in my app

    Hello
    I'm a new user to the forums, but have a little bit of java programming experience.
    currently i'm writing some business applications, one of which is a payroll system. The target audience is end-user bookkeepers so i am planning for a GUI front end.
    My first question relates to how programs save their state. for example, each month the bookkeeper will launch the program and add the next months payments, or he/she will open the program to fix a mistake. In general how do programs like word, excel (or anything) save and load files to work with? I was thinking about using XML. I thought i would load in an XML file containing all work so far, and then the user could save to it, which would add the new work.
    Question the second: A lot of gui java apps i use (like argo, symphony etc) have standard menus at the tops. Items like open, save, close, print etc. How are developers actually doing this? is there some premade classes i can just use in my programs as well that would be me this funtionality? This kindof relates to my first question about saving and opening. Further, it seems there are two GUI libraries to consider - either SWT or Swring. Eclipse plugins are written in SWT (from what i have heard). Can anybody recommend which API i should be using to create a GUI for my program?
    I think that's it for now. If anybody can provide me with advice i woudl be most grateful, as i'm at a bit of a standstill with my development.
    thanks.
    Edited by: minofifa on Oct 25, 2007 1:09 PM
    attempted to take topic off the watch list - sorry guys

    My first question relates to how programs save their state. for example, each month the bookkeeper
    will launch the program and add the next months payments, or he/she will open the program to fix a
    mistake. In general how do programs like word, excel (or anything) save and load files to work with? I
    was thinking about using XML. I thought i would load in an XML file containing all work so far, and then
    the user could save to it, which would add the new work. It sounds more like you are talking about saving the data instead of state--save in a database for mass and long term storage. Simple state info can be easily save in a database also or in a bean or text file.
    Question the second: A lot of gui java apps i use (like argo, symphony etc) have standard menus at
    the tops. Items like open, save, close, print etc. How are developers actually doing this? is there
    some premade classes i can just use in my programs as well that would be me this funtionality? This
    kindof relates to my first question about saving and opening. Further, it seems there are two GUI
    libraries to consider - either SWT or Swring. Eclipse plugins are written in SWT (from what i have
    heard). Can anybody recommend which API i should be using to create a GUI for my program?Maybe this is not what you are asking, but menu systems are implemented with Menu, MenuBar, MenuItem, etc objects in Java. The specifics of what happens when the individual menu items are selected are left up to the programmer.
    If you are looking for prebuilt menubars with code attached to perform common functions, then I do not know of any included in Java.

Maybe you are looking for

  • How do I handle a large movie file?

    My wife created a DVD using iDVD containing both slide shows and a couple of movies. The movies play fine in Preview mode, but not on the burned DVD. I read the help files for iDVD and they said that movie files larger than 1GB may not play correctly

  • Where to buy imac G5 LCD display 17in

    Hi, I need to replace my imac G5 display. It develops two approx 1.5in black blobs at the bottom left screen, after rainwater got into it and seep into it. I have dismantled the imac and got access to the LCD. Remove the rust spots on the frame and c

  • Registered application is not active at the moment.

    Two symtoms This happens with the Native Admin or any MSAD Shared Services admin. When in Shared Services - Right Click on Hyperion System 9 BI+ - the option to Assign Preference is not available Also when selecting the same project the following mes

  • Autologin Feature while using j_security_check

    Hi, I am new to web security APIs. In my application, I am using 'j_security_check' for authentication users. ie, My login page will call the 'j_security_check' action for authentication. I would like to give auto login feature in my application. So,

  • What's causing these power-up and login problems?

    I recently switched from Tiger to Leopard (installed by the repairers) and have encountered some power-up and login problems. Basically, my set up is that the computer automatically logs into a non-admin account, launches a Safari page, and then that