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

Similar Messages

  • Web links open black page and no file is downloaded

    Problem started under Lion, and continues under Mountain Lion: When I click on a Download link, the path of the file displays in the address field and the page goes black, but no file is downloaded. On links that allow it (not from the Flash Player, Skype, Mozilla, or Chrome download pages, for example), I can control-click to download a file. Under the Downloads button, if you erase the list, the button disappears. Before I had tried to download via control-click, that button wouldn't appear, not even among the toolbar customization options. I have upgraded to Mountain Lion, re-installed Mountain Lion, to no effect. Any suggestion will be greatly appreciated! Thank you.

    Select Help ▹ Installed Plug-ins from the Safari menu bar. Besides the following, what plugins are listed?
    iPhotoPhotocast
    Java
    QuickTime
    Shockwave Flash
    WebKit built-in PDF

  • 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

  • Oepe-12.1.2.1-kepler how to use ADF Templates in JSP page

    Hi all,
        I use oepe 12.1.2.1 kepler 4.3 and creating JSP page but I can't see any ADF Rich Faces Page in JSP Templates Page of Preferences Dialog. How to use ADF Templates in JSP page?
    Thanks,
    Thomas

    Select the JSP Templates link. Is the ADF Rich Faces Page template listed? Refer Creating the Login Page/4.
    Introduction to the Oracle Enterprise Pack for Eclipse (OEPE) IDE

  • How to print new line in jsp page

    hi
    how to print new line in jsp page
    thanks

    \n - new line character is in java specific not HTML
    specific.Well, if the correct line separator sequence (by far not always \n) would be used, it does add a new line to the HTML output. Too bad that you don't want to see HTML but formatted text. The BR tag is a formatting element for the displayed text, not a line break in HTML. ;)

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

  • How to enable the EL in jsp page

    hi can u tell 'how to enable the EL in jsp page'?

    *I am getting below exception in tomcat when i inclued +<%@ page isScriptingEnabled="true" isELEnabled="true"%>+*
    org.apache.jasper.JasperException: /index.jsp(1,1) Page directive has invalid attribute: isScriptingEnabled
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
         org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:311)
         org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:106)
         org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2388)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2394)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
         org.apache.jasper.compiler.Validator.validate(Validator.java:1700)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • How to call BPEL process in JSP page

    Hi
    I am new to BPEL.please help me how to call BPEL process in JSP page.
    Thank You...

    Check this thread ....
    How can i call asyncronous BPEL process from Java Class????
    Tom..

  • How to Hightlight the Data in Jsp Page

    How to Hightlight the Data in Jsp Page,
    I am doing doing search page,based on values given search page those are sent to servlet,in servlet based on some conditions if particuler id i am getting then i am redirecting to Respective jsp page with highlight the data from database..
    Thanks in advance...

    "Highlighting data in JSP sounds strange".
    Without looking at your search specific algorithms I feel you are finally going to display a page (HTML content) to user which contains highlighted text. Highlighting is not directly related to server side language you use (JSP, ASP, PHP etc.). This is purely HTML and CSS. However, server side script (such as JSP) should generate HTML content for getting highlight effect.
    Following HTML shows highlighted text using background-color property on span element.
    <html>
      <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
      </head>
      <body>
          <p style="font-size:1.1em">This is a long paragraph which contains <span style="background-color: yellow;">highlighted text</span> and non highlighted text.</p>
      </body>
    </html>Thanks,
    Mrityunjoy
    Edited by: mrityunjoy on 14 Jun, 2010 3:30 AM

  • How to debug a bean in JSP page with JBX???

    How to debug a bean in JSP page with JBX???
    i have a bean within a JSP page. i wanna find out how do they varibles work and changes of them values.
    are there some ways or tools to get the situations of them in visual way? just like when i debug VB program,i can get the situations in immediately window.

    help me !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • How to pass parameter to intro.jsp page ?

    Hi all,
    Anybody please tell me how to pass parameter to intro.jsp page.
    Is there any param name defined in <forward > syntax ?
    I have made following configuration in struts-config.xml file.
    I want to pass parameter to intro.jsp page
    <global-forwards>
              <forward name="invalidsession" path="/intro.jsp" redirect="true" />
    </global-forwards>
    please reply soon.
    Thanking you.

    Hi all,
    I have a similar kind of question..
    Iam trying to pass a string variable from JSP to servlet thro URL..
    Im using tomcat5
    COde:
    String fname=request.getParamter("filename");
    <jsp:forward page="/servlet/coreservlets.filedownload?name=" +fname />
    It is generating a unterminated tag error..Please help..

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • How can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?

    Hi,
    I would like to know as to how can I add links to open xml and csv files stored in another location? Please advice how to place links in my frame maker document?
    Kindly advice.
    Thanks
    Priya

    Special > Hypertext > Command "open document" will do its best to open the target document inside FrameMaker, which may not be much help; Special > Hypertext > Command "message …" will use the application you specify. The user guide for 7.0 says this about absolute links, and I don't think anything has changed since:
    For example, to start PaintBrush and open the Ship.pcx file on drive C you would use the command message system pbrush.exe C:/Ship.pcx
    I've not often used a relative link, and not recently: the same source says
    folder levels are separated by a slash / even in Windows and Mac
    [relative links] FrameMaker searches for a relative pathname beginning in the folder that contains the current document
    [absolute links] FrameMaker searches for an absolute pathname beginning at the top of the file system. In Windows, the absolute pathname begins with the drive specifier, a colon and a slash.

  • How to connect particular BAPIs to  jsp page

    HI ALL,
    I NEED HOW TO CONNECT BAPI TO JSP? I NEED EXAMPLE PROGRAM.
    ALREADY ONE TASK IS COMPLETED IN WEBDYNPRO...MY AIM IS CONVERT INTO FULLY JSP PAGE....PLEASE FIND THE SOLUTION..

    HI ALL,
         Please anyone tell how to connect bapi to pure jsp page in NDS...
       and how to run pure jsp page in NDS...

  • How to place a image in a page?

    pls anyone guide me? how to place a image in a page?
    thanks,
    screen410099

    Take a look at the code found in this function:
    SDKLayoutHelper::PlaceFileInFrame
    As expected you can find it in the SDKLayoutHelper file usually found in the Common folder of the SDK.  Anyway it has an example of one way of achieving your goal.
    There are other ways as well.  Here is some code from one of my plugins which uses the LoadPlaceGunCmd boss:
              PMRect pRC = itemGeometry -> GetPathBoundingBox(InnerToPasteboardMatrix(pParentTransform));;
              // Create an ImportCmd:
              InterfacePtr<ICommand> importAndLoadPlaceGunCmd(CmdUtils::CreateCommand(kImportAndLoadPlaceGunCmdBoss));
              //InterfacePtr<ICommand> importAndLoadPlaceGunCmd(CmdUtils::CreateCommand(kImportFileCmdBoss));
              if (importAndLoadPlaceGunCmd == nil)
                  ASSERT_FAIL("importAndLoadPlaceGunCmd invalid");
                  break;
                URI URIPath;
                URIUTILS -> IDFileToURI(path, URIPath);
              // Set the IImportResourceCmdData Interface's data:
              InterfacePtr<IImportResourceCmdData> importFileCmdData(importAndLoadPlaceGunCmd, IID_IIMPORTRESOURCECMDDATA);
              if (importFileCmdData == nil)
                  ASSERT_FAIL("importFileCmdData invalid");
                  break;
              importFileCmdData -> Set(db, URIPath, (K2::UIFlags)0, kTrue, kFalse);
              ErrorCode status = CmdUtils::ProcessCommand(importAndLoadPlaceGunCmd);
              const UIDList* imageList = importAndLoadPlaceGunCmd -> GetItemList();
              if (!imageList || imageList -> Length() == 0)
                  break;
              UIDRef imageFrame = imageList -> GetRef(0);
              InterfacePtr<IHierarchy> imageFrameHierarchy(imageFrame, UseDefaultIID());
              UIDRef newImage(db, imageFrameHierarchy -> GetChildUID(0));
              imageFrameHierarchy -> Remove(imageFrameHierarchy -> GetChildUID(0));
              // Create an placeGraphicCmd:
              InterfacePtr<ICommand> placeGraphicCmd(CmdUtils::CreateCommand(kPlaceItemInGraphicFrameCmdBoss));
              if (placeGraphicCmd == nil)
                  ASSERT_FAIL("placeGraphicCmd invalid");
                  break;
              placeGraphicCmd -> SetItemList(UIDList(newImage));
              // Set the IPlacePIData Interface's data:
              InterfacePtr<IPlacePIData> placePIData(placeGraphicCmd, IID_IPLACEPIDATA);
              if (placePIData == nil)
                  ASSERT_FAIL("placePIData invalid");
                  break;
              placePIData -> Set(pageItemRef, nil, kFalse);
              // Process the ImportAndPlaceCmd:
              status = CmdUtils::ProcessCommand(placeGraphicCmd);
    HTH.
    John

Maybe you are looking for