Traversal links in jsp

Hi,
I need to build traversal links that is similar to yahoo education website,i,e if you click a link, say "Thesaurus", the webpage will show a clickable links to show you position such as
Yahoo! Education > Reference > Thesaurus
Any suggestions will be appreciated

hey navi,
I am not clear with what u actually want, can u explain your problem with code, so that I can understand it better. because creating a link is nt a big problem at all

Similar Messages

  • How to Link another JSP Page in the same portal component

    Hi Guys,
      I am a new guy to SAP, currently, I want to add href link to another JSP in the same component, so I used <a href="<%=webpath%>/jsp/AboutPage.jsp">, but obviously, the link can not display target page due to privilege restriction, does anyone know how to resolve this problem? thanks very much!
      Best Regards
      James

    Thanks srinivas,
       Sorry for late response, too busy yesterday.
       Currently, I want to create a URL link in the page which links another JSP page in the same portal component, but the problem is this JSP page is under PORTAL-INF folder, so due to privilege problem, I can not create the link like the following:
    <a href="jsp/test.jsp">Link</a>
       I konw if I move test.jsp out of folder PORTAL-INF, the above way should work, but then, I found the JSP page can not access componentRequest and get resource bundle object.
      Am I clear, please let me know, thanks!
    Regards.
    James

  • Creating a file download link on jsp

    I have the following on my jsp. The code worked fine until I tried to use it in a new html design page.
    <code>
    //page name is index.jsp
    try //DISPLAY THE CONTENTS OF THE DATA DIRECTORY
    File dirname = new File(PATH); // create an instance of the File class
    if (dirname.exists()&&dirname.isDirectory())//check to see if File class dirname exists and is valid
    String [] allfiles = dirname.list();//create an array of files in the dirname File class
              for (int i=0; i< allfiles.length; i+=2)//loop through allfiles[] and print out file links
    out.println("<br><table border='1' cellspacing='1' width='99%'>");
                   out.println("<tr><td width='50%' class='pageFont'><input type='checkbox' name='cb' value='"+allfiles[i]+"'>"+allfiles[i]+"      ");
    %>
    <a class="a" href="index.jsp?downfile=C:\\data\\<%=allfiles[i+1]%>">DOWNLOAD</a></td>
    <% if(i+1 < allfiles.length)//PRINTS OUT THE SECOND TD SO THAT WE HAVE 2 COLUMNS OF LINKS
    out.println("<td width='50%' class='pageFont'><input type='checkbox' name='cb' value='"+allfiles[i+1]+"'>"+allfiles[i+1]+"      ");
    %>
    <a class="a" href="index.jsp?downfile=C:\\data\\<%=allfiles[i+1]%>">DOWNLOAD</a></td></tr>
    <%
    out.println("</form></font></table>");
    catch (IOException excep)
         out.println("An IO exception has occured.");
    </code>
    Then when clicked this code is run:
    <code>
    try{
    //CHECK TO SEE IF THE FILE HAS BEEN CLICKED TO DOWNLOAD SINGLE FILE
    if (request.getParameter("downfile") != null)
    String filePath = request.getParameter("downfile");
    File f = new File(filePath);//CREATE AN INSTANCE OF THE FILE CLASS AND POINT IT TO THE LOCATION OF THE DIRECTORY CONTAINING THE FILES
    if (f.exists() && f.canRead())
    response.setContentType ("application/octet-stream");
    response.setHeader ("Content-Disposition", "attachment;filename=\""+f.getName()+"\"");
    response.setContentLength((int) f.length());
    BufferedInputStream fileInputStream = new BufferedInputStream(new FileInputStream(f));
    int i;
    out.clearBuffer();
    while ((i = fileInputStream.read()) != -1) out.write(i);
    fileInputStream.close();
    out.flush();
    </code>
    When I click on this link I get the download dialog box. If I open it I get the following open up in notepad(the files I am trying to give download links are .txt files)
    Below is what is displayed in notepad ALL on 1 line:
    <html>
    <head>
    <LINK rel="stylesheet" ty
    That is displayed in all of the links that I click on. It is the first few lines of html code for index.jsp.
    I know this code is probably not a good way of doing what I need but I got it to work fine until the change.
    I am sure there is an easier way to code the download link without resubmitting the page.
    Thanks in advance!!

    Well all was fine with this jsp until I moved it to ApacheJServ. Now the problem has resurfaced(although it is a little different now)
    I had moved the following code to the top of my page:
    //CHECK TO SEE IF EITHER DOWNFILE OR ZIPFILE VARIABLE EXIST, AND IF THEY DO SET CONTENT TYPE BEFORE SENDING ANY HTML CODE TO THE BROWSER
    try{
    //CHECK TO SEE IF THE FILE HAS BEEN CLICKED TO DOWNLOAD SINGLE FILE
        if (request.getParameter("downfile") != null)
                String filePath = request.getParameter("downfile");
                File f = new File(filePath);//CREATE AN INSTANCE OF THE FILE CLASS AND POINT IT TO THE LOCATION OF THE DIRECTORY CONTAINING THE FILES
                    if (f.exists() && f.canRead())
                        response.setContentType ("application/octet-stream");
                        response.setHeader ("Content-Disposition", "attachment;filename=\""+f.getName()+"\"");
                        response.setContentLength((int) f.length());
                        BufferedInputStream fileInputStream = new BufferedInputStream(new FileInputStream(f));
                        int i;
                        out.clearBuffer();
                        while ((i = fileInputStream.read()) != -1) out.write(i);
                            fileInputStream.close();
                            out.flush();
                            response.flushBuffer();
    catch (Exception e){}
    //This is where the java code ends and the javascript/html code begins.Then further into the page I create the file download links like so:
                            <a class="a" href="main.jsp?downfile=C:\\data\\<%=allfiles[i+1]%>">DOWNLOAD</a>I know this isnt a secure way of doing this but I am on a intranet.
    The problem I am having now is that when I click on one of the links and download the file and then open it, I get the contents of the file plus concatenated to the end of it is the first few HTML lines of the actual jsp that I downloaded the file from. Before I was just getting the first few lines of html from the jsp, not the actual contents of the downloaded file.
    This is an example of what I am getting:
    This is the contents of the file that I downloaded.//This is where the file contents ends.
    <html>
    <head>
    <LINK rel="stylesheet" type="text/css" href="default.css">
    <script language="JavaScript1.2">
    //function that allows user to select all checkboxes
    function doIt(v)
    for(var i=0;i<document.form1.cb.length;i++)
       document.form1.cb.checked=eval(v);
    function swap(imageName,image)
    imageName.src = "templateImages/"+image;
    function imageOver(imageSrc, imageName)
         changeImage = new Image();
         changeImage.src = imageSrc;
         document.images[imageName].src = changeImage.src;
    var hide = true;
    function hideShow( ) /
    Any morre ideas?
    TIA!
    BTW, I went to ApacheJServ because they wont let me use tomcat :(

  • Dynamic links in JSP

    Hi guys,
    I have a JSP page which prints the results from a servlet thru a bean. I am using logic:iterate to run thru the results and to print them. My problem is that i have to display information based on a particular result (when clicked) in another JSP page. I have all the information stored in the bean. I just have to pick the right data according the link. I was looking at the logic tag again but could not get any hint of how to do it.
    Can anyone help...please!!!!
    thanx in advance

    Hi sampathnk,
    i am not sure if what i am doing is right!!!
    this is what i am doing...
    the following section is in my first JSP where i print the brief results...
    <logic:iterate id="courseresults" name="Results">
    <tr>
    <td width="15%"><bean:write name="courseresults" property="coursecode" /></td>
    <td width="85%">"><bean:write name="courseresults" property="coursename" /></a></td>
    </tr>
    </logic:iterate>
    and this section is my second JSP where i print the course details when clicked on a scpecfic course in the first JSP..
    <logic:iterate id="coursename" name="Results">
    <tr>
    <td width="20%"><bean:write name="coursename" property="coursedesc" /></td>
    <td width="20%"><bean:write name="coursename" property="degree" /></td>
    <td width="20%"><bean:write name="coursename" property="units" /></td>
    <td width="20%"><bean:write name="coursename" property="studyperiod" /></td>
    <td width="20%"><bean:write name="coursename" property="strand" /></td>
    </tr>
    </logic:iterate>
    the first JSP is working fine but when i click on the course it gives me a ServletException as follows...
    cannot find bean Results in any scope
    can u please help me fix this problem..
    thanx

  • How to place download link on jsp page to download files eg. Download PDF

    Hi,
    I have made an appliaction in struts 2 which creates PDF,its working fine now i want to place a link on my jsp page from where i can click and download that PDF file which i have created and store on my local location. Also i want to to know can i place links on my jsp page to download other type of files if i want to give link on my page to download Images or songs how can i do that,
    Help plzzzzzzzzzzzz

    IF You are using jsf then simply <h:outputLink value="file:///D:/Me/Image000.jpg"/>. This generates HTML <a> tag and value attribute replacing with <a> tag's href attribute.If you are using other technologies try to find which tag generates HTML <a> tag.
    I think You also can simply place HTML <a> tag wherever You want

  • Linking one JSP to another

    How do you create a link going from one JSP to another?
    I would like to know how to go by clicking on a link on the first page which when clicked will take you to the second.
    I would also like to know how to go to the next page if a certain condition is met.
    Thank you in advance.

    Sorry I was not that clear before.
    I would like to know how to open another JSP page if a
    button I have setup is pressed in my first JSP page.
    Thank you.
    <SCRIPT>
    f()
       document.myForm.submit() ;
    </SCRIPT>
    <FORM ACTION="secondPage.jsp" METHOD="POST" NAME="myForm">
    <INPUT TYPE="button" VALUE="Close Window"   onClick="f()">
    </FORM>

  • Error in crosstab links in JSP

    Hi,
    I am able to run a crosstab inside a JSP from JDeveloper10g(9.0.5.16.27)'s oc4j, but when I click on the links in the crosstab either to drill into a column/row or any of the button(uix) links, there is a javascript error which is something like :
    Line: 33
    Char: 1
    Error Object expected
    Code:0
    URL:<url for the page>
    Has anyone seen this error before ? How do I fix this?
    thanks
    Shankar

    If you do not have access to the beta forum I suspect you are not using the 10g Beta product. If this is the case, the current production version of BI Beans is not certified with JDeveloper 905. The current version of BI Beans is certified with JDev 904. You will have to wait for BI Beans 10g to release later this year to be able to use JDeveloper 905/10g.
    Hope this helps
    Business Intelligence Beans Product Management Team
    Oracle Corporation

  • Attachement file links in JSP dont open

    Hi All,
    In my JSP page, I have attachment file links which are as follows:
    xlserror.ppt
    When I click on the link, a new browser opens and it shows all garbage. The browser is not able to find PowerPoint application to display the file. What could be the problem? Am using Win NT as my server and Tomcat as the JSP container.
    Previously I had this application in IIS, ASP combination which opened all the attachments in the browser by finding the correct application.
    Another question is:
    Is how you name the file critical? Coz following is one of the prblems that I have seen. If I name the file "xlserror#1.ppt" then following is the link:
    xlserror#1.ppt
    When I click on the link, the browser goes to the following location:
    http://domain/MyApp/Attachments/757/xlserror
    and therefore I get "resource not found" error. Is using '#' in the filename not good practice? I never had this experience with ASP.
    Regards,
    m_asu

    1) For your browser to know what application to use you have to declare the kind of content you are sending to the browser.
    So you have to set the content type of the response object with the proper MIME type.
    For ppt files, i think is application/vnd.ms-powerpoint or something similar, check it.
    2)About the # character: If you have a # in your url ( www.server.com/app/docum#ent) ,your browser will ask for the www.server.com/app/docum and then will scroll down the page till the ent anchor.
    (This is basic html. Maybe you should go to the w3schools.com ;) )
    HTH

  • Identifying links in jsp???

    hello friends....
    there is a problem ...
    i couldnt do one thing ...
    i have a JSP in which i am generating links in loop....
    like:
    id name address link1 link2
    and so on number of those in the loop.
    now whenever any lin is clicked same jsp is clled.
    the problem is that i want to identify the link that has been clicked and hence the data attached to it.
    how is this possible..
    please show me a way...
    thanks a lot !!!
    navi

    hey navi,
    I am not clear with what u actually want, can u explain your problem with code, so that I can understand it better. because creating a link is nt a big problem at all

  • Accessing content in WebLogic Content Management system via link in JSP

    We are running WebLogic 8.1 (sp4) and are learning about the BEA Content Management System and what we can do with it. We have a user request to pull out the content based on certain indexes and display the titles as links in a JSP. The links in the JSP would actually allow the user to pull down the document.
    <BR>
    Is this possible?
    Could someone send an example on how to do this?
    <BR>
    Thank you,
    <BR>
    Robert
    <BR>
    This is what we have so far (which builds a link, but we don't have the correct mapping to open/save/etc. the file):
    <br><br>
    <pz:contentSelector rule="ProgramPublicLinks" id="pubLinks"/>
    <utility:notNull item="<%=pubLinks%>">
    <utility:forEachInArray array="<%=pubLinks%>" id="plink" type="com.bea.content.Node">
    <BR><BR>
    [a href="<%=request.getContextPath() + plink.getPath() %>"]
    <BR>
    <cm:getProperty id="plink" default="No content node found." name="binary" resultId="link"
    conversionType="url" />
    <%= link %>
    <BR>
    [a]
    <BR><BR>
    </utility:forEachInArray>
    </utility:notNull>

    Hi Robert,
    Take a look at the DownloadBinaryServlet. You can use this to download a CM Node's binary property value.
    If you are displaying images, the ShowPropertyServlet is probably a better match. (build up an image href URL to the ShowProperty servlet)
    -Steve

  • JSP initialization and connection to R3 using  a link in JSP

    Hi all,
    I am new to JSP's. I need java scriptlet code for jsp initialization.Also in my jsp page i need to make a link and on clicking, this link should fetch data from the backend R3 system.
    Suggest some help.
    Pooja Gehani

    I think You need to read something about JCO (JavaConnector) - is java based library thanks to it You can make calls to function modules in R3 system (for example fetch data using some function module). When it comes to jsp please check some tutorials in SDN or Google cause it is difficult to explain You jsp technology in few words.
    Below is example of jsp page which connects to R3 System, invoke some function with some parameters, gets return table and save it to file rettab.html.
    Remeber to add sapjco.jar to classpath.
    Please reward points if it was helpful.
    <%@ page import = "com.sap.mw.jco.JCO.*" %>
    <HTML>
    <head>
    </head>
    <body>
    <%
              JCO.Client mConnection;
              mConnection = JCO.createClient("001","koperski","password",null,
                   "127.0.0.1","01");
              JCO.Repository mRepository;
              mRepository = new JCO.Repository("myRep", mConnection);
              try {
                   mConnection.connect();
                   IFunctionTemplate funcTemplate =
                        mRepository.getFunctionTemplate("someFunction");
                   JCO.Function function = funcTemplate.getFunction();
                   ParameterList parameterList = function.getImportParameterList();
                   parameterList.setValue("0010000000082","someParameter");
                                           JCO.Table retTable =
                   function.execute();     function.getTableParameterList().getTable("SomereturnTab");
                   retTable.writeHTML("f:\rettab.html");
                            mConnection.disconnect();
    catch (Exception e) {}
    %>
    </body>
    </HTML>

  • How to call a link in jsp

    hello,
    i have some link saved in w="www.yahoo.com" w is saved in some table which contains many links
    doing it like this
    out.println("<a href=< www.yahoo.com >yahoo</a>");
    make it fixed and i can't change the web page address which is readed from some database.
    any ideae how to do that
    because
    out.println(("<a href=< w >yahoo</a>"); not working.
    thanks in advance
    Farag

    <html>
    <body>
    <%String address = "http://www.yahoo.com/"; %>
    <%String name = "yahoo"; %>
    <a href=<%=address%>><%=name%></a>
    </body>
    </html>

  • Hyper links in JSP

    hello everyone............ im new to JSP . I have a data base of products which are categorised as a particular class of products belonging to a particular family totally i have 3 tables Family, class and product now to search for a product page shld show all the elements in family then when user clicks on one of the family item it shld show the respective class of products that come under it ie,
    select class_name from class where FID=xx;
    dynamically based on users click it shld be able to identify the family can u suggest me some tips ....................

    Yes I am also not understanding your question properly.I think i understand from your question.If u select one data it should display the related code in class i think .
    This is the javascript code. If u select Brand that equalant product will display.
    If u understand try it.....
         function getProduct()
         var j=0;
         var l=0;
         var brand= document.enter.brand.value;
         document.enter.b_type.options.length = 0;
         // alert(brand);
         <%
         for (int i=0;i<brandproducts.getFetchSize();i++)
         %>
         var selBrand = "<%=brandproducts.getString(i,"brand")%>";                         
              if (brand == selBrand)
              myOption = new Option();
              <%
              String pro_code = brandproducts.getString(i,"product");
                   for (int j=0;j<products.getFetchSize();j++)                    
                   if(pro_code.equalsIgnoreCase(products.getString(j,"code")))
                   %>
                        myOption.text =     "<%=products.getString(j,"product_name")%>";
                        myOption.value ="<%=products.getString(j,"code")%>";
                   <%
              %>                                     
              enter.b_type.options[j++] = myOption;                    
         <%                    
         %>          
         }

  • Href link in JSP page not working?

    Hi All,
    I am creating a web app that at various points accesses various files from a local repository (the app will be installed on WAS instances on local servers and the repository will be on the server with a WAS variable pointing to its location - so the web app knows where it is)
    On my web page I am trying to have a list of links to generated reports that will be stored in the repository:
            <td><a href="<%out.println(stubHome + "\\reports\\");
                      out.println(serviceArray);
         %>.html">View results</a>
    </td>where stubHome is the location of the root of the repository and serviceArray is a list of the specific report names.
    When I view the site the "View results" link appears as normal (blue/underlined) and when I hover the mouse over the link I see in the bottom left of the IE window "file:///D:/stubRepo/reports/Service1.html"  - which is the correct the name/location of the stored report - and if i just paste that link into my address bar on teh browser then the file opens.
    However, if i try to click on the link directly on my web page nothing happens and there are no signs of anything happening... any ideas what might be wrong?
    Thanks in advance guys!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    rmh1 wrote:
            <td><a href="<%out.println(stubHome + "\\reports\\");
              out.println(serviceArray);
         %>.html">View results</a>
    </td>
    This is a bad approach. Use JSTL/EL.
    "file:///D:/stubRepo/reports/Service1.html" - which is the correct the name/location of the stored reportDo you realize that this path refers to the local filesystem? Do you also realize that this file must be available at every client who is visiting your website?
    However, if i try to click on the link directly on my web page nothing happens and there are no signs of anything happening... any ideas what might be wrong?I have no idea, it might even be browser dependent, but you should be using URL's rather than local files.

  • Displaying privious 7 days and net 7 days link in jsp

    hi
    i am using jsp
    in that jsp i vant display only last 7 days details.
    i am getting all values in database and stored in to an arraylist.
    in that arrylist date also onthing.
    according to the date i have to display the 7 days list.
    for that vhat i have to use.I dont know.
    but it is needed very urgent.
    anybody knows help me
    thanks.

    first, you really need to learn to express yourself more clearly - e.g. learning better english. I have no idea what you mean ...

Maybe you are looking for