Photo using jsp

iam using this standrad function module HRWPC_RFC_EP_READ_PHOTO_URI  using JSP i want photo

Below coding iam using to display image at that u have given some coding where i have to place that
PrintWriter out = response.getWriter();
                    String from = request.getParameter("num1");
                    //String to = request.getParameter("num2");
                    out.write("Hi servlet");
                    JCO.Client mconnection =
                              JCO.createClient("180",
                                                       "jshaik",
                                                       "1Q2W3E",
                                                       "EN",
                                                       "150.0.150.141",
                                                       "04");
                         out.write("created client");
                         try{
                              mconnection.connect();
//                              out.write("connnected");
                              JCO.Repository mrepository = new JCO.Repository("JCO Sample",
                                                                      mconnection);
//                              out.write("connnected");                         
                              IFunctionTemplate functiontemplate =
                                        mrepository.getFunctionTemplate("HRWPC_RFC_EP_READ_PHOTO_URI");
//                              out.write("got fn template");
                              JCO.Function function = functiontemplate.getFunction();
//                              out.write("got fn template");
                              function.getImportParameterList().setValue(from, "PERNR");
                              //function.getImportParameterList().getStructure("DESTINATION_TO").setValue(to,"CITY");
                              mconnection.execute(function);
//                              out.write("fn executed");
//                              JCO.Table mytable = function.getTableParameterList().getTable("FLIGHT_LIST");
//                              response.setContentType("text/html");
//                              out.write("<html>" +
//                                             "<body>" "<table border='2'> "
//                              "<th> <td> AirLine <td> From City <td> To City<td>Date<td>Price </th>");
//                              for(int i=0; i<mytable.getNumRows(); i++, mytable.nextRow()){
//                                   out.write("<tr>");
//                                   out.write("<td>"(i1));
//                                   out.write("<td>"+mytable.getString("AIRLINE"));
//                                   out.write("<td>"+mytable.getString("CITYFROM"));
//                                   out.write("<td>"+mytable.getString("CITYTO"));
//                                   out.write("<td>"+mytable.getValue("FLIGHTDATE"));
//                                   out.write("<td>"+mytable.getValue("PRICE")
//                                                  + " " + mytable.getValue("CURR"));
//                              out.write("</body>" +
//                                          "</html>");
                              String customer = function.getExportParameterList().getValue("URI").toString();
                            // String customer1 = function.getExportParameterList().getValue("LNAME").toString();
                                         //JCO.Table mytable = function.getTableParameterList().getTable("PERSONALDATA");
                                    response.setContentType("text/html");
                                         out.write("<html>" +
                                                        "<body>" + "URI"  + customer 
                                                         "</body>""</html>");
//                                                             "<table border='2'> "+
//                                                        "<th> <td> AirLine <td> From City <td><td><td> </th>");
//                                                        for(int i=0; i<mytable.getNumRows(); i++, mytable.nextRow()){
//                                                             out.write("<tr>");
//                                                             out.write("<td>"(i1));
//                                                             out.write("<td>"+mytable.getString("PERNR"));
//                                                             out.write("<td>"+mytable.getString("EMPNAME"));
//                                                             //out.write("<td>"+mytable.getString("CITYTO"));
//                                                             //out.write("<td>"+mytable.getValue("FLIGHTDATE"));
//                                                             //out.write("<td>"+mytable.getValue("PRICE")
//                                                                            //+ " " + mytable.getValue("CURR"));
//                                         out.write("</table></body>" +
//                                                     "</html>");
//                              out.write(returnstruct.getName());
                         }catch(Exception e){
                              out.write("exception");
                              out.write(e.getLocalizedMessage());
                         }finally{
                              mconnection.disconnect();

Similar Messages

  • How can I upload an image using JSP in database(MySQL)

    I have to develop an application in which users can register themselve by filling up thier information(name, address) etc along with their photo.
    Storing nam etc. is simple but i am unable to upload photo using JSP.

    Here are lot of examples: http://www.google.com/search?q=jsp+file+upload
    Or if you actually have implemented something which doesn't work as expected, then please ask specific questions.

  • Dynamic Photo Album using JSP

    Hi all,
    I've been having a bit of trouble getting help with my question - I've tried a couple of usenet groups, however don't seem to be asking the right question. So, I'm hoping that some Java forums may be of more relevance. I'm sorry if this is the wrong place, and if there is a better place for me to ask my question if you could tell me where that is, I'ld be greatful.
    I am looking at finding/ making an online dynamic photo album which
    uses JSP. I've seen a lot of examples using PHP and a few online
    albums using Javascript, however those albums using JavaScript are not
    dynamic - the images are hard coded.
    My scenario is this, we have about 6 different events with about 150
    photos each. What I would like to happen is to be able to have a index
    page which lists 10 photos each, and when you click on the photo to be
    taken to a secondary page with a larger image. I would like to do this
    without needing to create 150 dependant pages.
    I understand that we will be looking at using server side technology.
    As our pages already use JSP we don't want to add a second server side
    language (PHP, Pearl etc...) to the equation.
    So does anyone know of a script that may already do this? As I seem to be having no luck in finding one to suit my purpose, I would be happy to create my own script.
    The problem is that I am not too familiar with JSP - though I used to do a fair bit of ASP using VB Script. What I would like is to be pointed into a page that will show me how to create an array with a list of filenames in a given directory (using a Site relative path). From there I should be right, but I can't seem to find any references to how this can be done using JSP (or even Javascript).
    If anyone can help me I would greatly appreciate it.
    Regards
    Linda

    You need to File class, it can produce a list of files in a directory.
    File photodir = new File("c:/path/to/photos");
    File[] photos = photodir.listFiles();
    for(int i = 0; i < photos.length; i++){
    File fp = photos;
    if(fp.isFile()){
    // check to see if it is an image

  • I have a packardbell laptop with photoshop elements 8 installed from new. I have used it on several occasions but I cannot get it to run now.  When I open a photo using elements the Adobe box pops up saying that the programme has unexpectedley quit? can a

    I have a packardbell laptop with photoshop elements 8 installed from new. I have used it on several occasions but I cannot get it to run now.  When I open a photo using elements the Adobe box pops up saying that the programme has unexpectedley quit? can anyone help me please as I have several photos to edit before the end of this month. Many thanks for any help

    The "restore disk" is built into the Mac. See About Recovery.
    Need more specifics about what error messages you got while installing Adobe Flash.
    However, you can almost avoid Flash altogether by setting YouTube to play the HTML5 version instead.
    Click the Try something new! link at the bottom of the YouTube page.
    I don't know about the sound issue. Might be hardware as you think. Try other headphones to check.

  • Using jsp:param

    hi,
    i am new to java and jsp programming and i am trying to use jsp:param nested in my
    jsp:forward statement.
    if i specify a value in jsp:param my page would display properly. however when i passed a variable in my jsp:param i get the error:
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\star\jsp\Meeting_CreateMinutes_jsp.java:135: cannot resolve symbol
    symbol : method encode (long)
    location: class java.net.URLEncoder
    pageContext.forward("Meeting_ActionItems.jsp" + "?" + "docno=" + java.net.URLEncoder.encode( carno ) + "&" + "formmode=" + "Add");
    ^
    1 error
    this is the snippet in my jsp page that (i suspect) caused the error:
    <% long carno = newcar.getDocno(); %>
    <jsp:forward page="Meeting_ActionItems.jsp">
    <jsp:param name="docno" value="<%= carno %>"/>
         <jsp:param name="formmode" value="Add"/>
    </jsp:forward>
    my question is : does jsp:param do not accept variables as values?
    thanks in advance.
    best regards,
    noynoy

    <% long carno = newcar.getDocno(); %>Change this part as
    <% String carno = ""+newcar.getDocno(); %>
    Hafizur Rahman
    SCJPhi Hafizur,
    Thanks a lot. It solved my problem on the jsp:param error
    More power!!!
    rgds,
    noynoy

  • Facelet to crare web app, instead of using JSP; JSF1.2 spec in WebSphere6.1

    Novice to JSF and Facelet. But, I had been using Struts since its inception.
    I am required to use IBM's WebSphere Application Server 6.1 that comes with Servlet 2.4 and JSP 2.0. WebSphere 6.1 App Server limits me to using JSF 1.1. This is because, JSF 1.2 requires Servlet 2.5 and JSP 2.1, that is a part of WebSphere App Server 7.0; not a part of WebSphere 6.1.
    Somebody suggested that it will be possible to use JSF 1.2 in WebSphere 6.1, if I were using Facelet, instead of JSP.
    I am not eager to use JSF 1.1 and may have to forego JSF; unless and until I can use JSF 1.2.
    The hold-up is that I cannot use JSF 1.2 spec in WebSphere 6.1. Is there is any way to use JSF 1.2 in WebSphere 6.1? Can I create an entire application using Facelet (instead of JSP) that will let me use JSF 1.2 spec in WebSphere 6.1? If so, how?
    Here are my questions, especially because I am not very familiar with JSF and Facelet technology:
    1. Can I use JSF 1.2 specification in WebSphere 6.1, if I were using facelet (as opposed to JSP) as my view technology?
    2. Will it be possible to create an entire web app with facelt, instead o fusing any JSP at all? If so, how? Does it mean that all the GUI screens will only use facelet and no JSP at all?
    3. Please explain how I can write a complex web app with 100s of screens using only facelet, instead of using JSP.
    4. Please provide pointer on how JSF and facelet differ, or what are their demarcations boundaries.
    Any comment and pointer will be greatly appreciated.

    Don't doublepost. It's rude. Stick to one topic. Continue here: [http://forums.sun.com/thread.jspa?threadID=5335001].

  • How can I  connect to SQL server database thru local network by using JSP?

    I'm currently doing a project by using JSP..And I need to display record from the SQL Server database in our school's local network. May I know how can I do that? How can I write the code so that I can able to access the SQL Server databsase Throught school's network by using JSP? Please tell me step by step how can I do that. I'm using Tomcat 4.1 as Web Server. And I had J2SE and J2EE installed in my computer.

    first you have to establish a ODBC DSN on your computer,
    that connects to the database...you can do that from your control pannel.
    i assume that the TOMCAT server is residing on your computer....(if the webserver is in other computer then you would have to create a System DSN on the data sources ODBC option in the settings>control pannel of that machine)
    then you can use that DSN name to connect to the data base from the class file....for further assistance on how to create the class that access the tutorials in sun site.
    regards
    G

  • IPhoto nightmare. Tried to import photos using Nikon software for the first time and all my photos disappeared from iPhoto 8.1.2 (and everything from itunes too). Newly reinstalled iPhoto crashes as soon as I import anything now.

    Macbook OSX 10.5.8, iPhoto 8.1.2. I just tried to import some photos using Nikon software (View NX2) for the first time. When I next looked into iPhoto it was empty (so was iTunes but that's another story). I had backed up photos fairly recently but don't use time machine. Searched in vain everywhere and must have done something wrong because iPhoto wouldn't then open at all, saying it was unreadable. After a lot more attempts to recover I uninstalled iPhoto and the receipts and reinstalled from my original disc. It seemed to be ok and imported some photos from my iphone but as soon as the import is complete iPhoto crashes and when opened again it is empty. Have tried this several times and have shut down and have tried rebuilding with the alt and cmd buttons but nothing seems to help. Any ideas?

    not a reply but not sure how to add something to my own thread! It seems that Desktop was damaged too as when I try to open it a screen says there is no application selected to open Desktop with. No idea what I should choose! Any help appreciated, have really made a mess of my MacBook this time.

  • How to get the values of an Array using JSP Tags

    Hey guys,
    I need some help. I've splited a String using
    fn:split(String, delim) where String = "1,2,3,4" and delim is ,
    This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
    Any help would be highly appreciated
    Thanks

    The JSTL forEach tag.
    In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
    <c:set var="list" value="1,2,3,4"/>
    <c:forEach var="num" items="${list}">
      <c:out value="${num}"/>
    </c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string.

  • I am unable to print color photos from i photo using a Brother Printer

    I am unable to print color photos from i photo using a Brother MFC-6490CW all in one.  The photos appear to be in grayscale.  I have checked the printer settings, but for some reason I am not able to access the color management on my printer from printer set up.  It only gives me the standard option.  I have spent hours checking Bother's website and Apple's and I am not able to come up with a valid answer.  I know that the color print works.  If I print something from the internet of from outlook it will print in color.  I know all of my cartridges are in working order, I have cleaned the print head on my Brother, but I am still not able to print photos in color!!!
    What puzzles me the most is why I am unable to really access the color management menu on my printer?  It just does not come up.  I have the option from paper handling to print photos, but this has nothing to do with the quality.  I have also tried printing the photo from an Adobe PDF file and I still have the same problem.  Can anyone point me in the right direction?  Thank you.

    In the Print dialogue box click on the little triangle to the right of the name of the printer. That will expand the dialogue box.

  • Report generation using jsp

    I am developing a website using jsp on tomcat.The site required a number of online report generation option from database(mysql).
    My problem is-
    1.how to generate different types of report other than simple html tag embedded within jsp .
    2.How to store all those reports in a file(.txt or .doc).
    N.B I dont want to use any reporting tool.

    Mantosh,
    Have you seen this developer zone article which details accessing Citadel Data using COM+ and ADO?
    http://zone.ni.com/devzone/conceptd.nsf/webmain/725A6C3843F13C8786256EA600633724#6
    Also, this KB article provides more detail on how to access Citadel data using SQL commands and I think will help answer your question:
    http://digital.ni.com/public.nsf/websearch/C7D32F9A59D4637086256A7200692F30?OpenDocument
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • How to open a pdf file in a web browser using jsp

    Hi,
    I have a problem opening pdf file in browser using jsp.the following is my code.Can anyone help me.Thanks
    response.setContentType("application/pdf");
    String filename="C:\\FictPos\\mypdf.pdf";
    File file = new File(filename);
    FileInputStream in = new FileInputStream(file);
    OutputStream out1=response.getOutputStream();
    byte[] buf = new byte[4096];
    int count = 0;
    while ((count = in.read(buf)) >= 0)
    out1.write(buf, 0, count);
    in.close();
    out1.close();
    }

    Don't know the problem specifically, but here are some suggestions to investigate:
    Does it show anything in the page when you view source on it?
    I would recommend using a servlet rather than a JSP page for this, if only for the fact the JSPs can insert carriage returns into places where you might not want them to. This might screw up the PDF file format?
    Try setting the a link to the jsp, right-click and "save target as..." just to see if it gets any response at all - ie bypass the browser display.
    Good luck,
    evnafets

  • How to download a file from server machine to client machine using jsp

    Hi,
    In my application, I have an excel file stored on my server machine. How can I download that excel file on to my client machine using jsp. Is there any other way I can open that file from my machine and save it in my machine using jsp/java?
    Its an emergency for me to do this.
    Can anyone provide me the full code to download a file from server machine as I don't have
    time to browse through various sites.
    thanks in advance,
    Tiijnar

    Please post your code using code tags (click on CODE above the text area, when posting)
    response.setContentType("application/octet-stream");Why octet-stream? Set the correct mime-type.
    String disHeader = "Attachment; Filename=\"filename\"";The filename should just be the file's name. Not the complete path to the file! This will tell anyone where the file is located on the server. It's also inconvenient because by default,the browser will suggest it as the name for the download.
    Your way of writing to the output stream is just plain wrong. See this snippet (picked from [http://balusc.blogspot.com/2007/07/fileservlet.html])
            BufferedInputStream input = null;
            BufferedOutputStream output = null;
            try {
                // Open streams.
                input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
                output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
                // Write file contents to response.
                byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                // Finalize task.
                output.flush();
            } finally {
                // Gently close streams.
                close(output);
                close(input);
            }

  • How can I display a confirm box using JSP?

    Dear All,
    I am new to the Java language; please help!
    What I'd like to do is to prompt the user, within a loop, to click OK to continue the loop or CANCEL to exit the loop. I've tried to use JavaScript in conjunction w/ Form submittion to handle the parameter passing ('true'/'false') of the confirm box to a JSP. Yet, every form submission will cause the JSP page to re-load from the top which is the incident I'd like to avoid.
    Is there anyway I can have a confirm box written using JSP? Please help!!
    Thanks,Wing.

    if you do any modifications in the jsp page the whole page will be refreshed to show the latest result after modification.
    if you dont want the whole page to be refreshed
    you can pass the control to another page after the confirm box or you can use frames to your interest.

  • How can I copy multiple slides with a HP Scanjet 4050 to photoes using Maverick? HP apparently no longer supports this product for this OS.

    How can I copy multiple slides with a HP Scanjet 4050 to photoes using Maverick? HP apparently no longer supports this product for OS Maverick.

    VueScan
    VueScan FAQ

Maybe you are looking for