URL writing

Hi,
I am getting very confused ! I have a prog that reads a file from a web server, and displays it in a TextArea. The user can then change the data in this TextArea, and I then want ot write it back to the web server. The number of choices for doing this seem vast, which is the best one to use ? I read the file like this :
URL source = new URL(getCodeBase(), f);
URLConnection url = source.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(source.openStream()));
while(section < 6) {  // read all data lines, for 5 sections.
          data = in.readLine();
          rawArray[rawCt]=data; //populate the rawArray;
          rawCt++;
Once I have an array of data, I populate the textarea (tArea1) and change it about. I then want to put it back, but my little grey cells are no longer working. Can someone please help !
regards
KPJ

Hi Guys,
for reference, I sorted this problem out. I needed to use a perl cgi prog
to take the data and save it. The java code had to emulate the HTTP POST command, and getting the syntax sorted for this was interesting ! The working solution for anyone interested is as follows:
public void SendData(String data) throws Exception {
     tArea1.append("\n\n************   Sending Data   ************\n");
     URL url = new URL("http","www.lagfc.co.uk","/cgi-bin/PerlUpdate.cgi");
     URLConnection ucon = url.openConnection();
     ucon.setDoOutput(true);
     ucon.setDoInput(true);
     ucon.setUseCaches(false);
     ucon.setRequestProperty("Content-type", "text/plain");
     ucon.setRequestProperty("Content-length", data.length()+"");
          PrintStream out = new PrintStream(ucon.getOutputStream());
     out.print(data);
     out.flush();
     out.close();
     tArea1.setText("*************************************");
     tArea1.append("\n*****     Data sent to host     *****\n");
          DataInputStream in = new DataInputStream(ucon.getInputStream());
     String s;
     while((s=in.readLine()) !=null){ // Read in response from CGI
     tArea1.append(s);
     in.close();
          tArea1.append("\n*************************************\n");
   } // end of sendDataThe CGI File that handles the data is
#! /usr/bin/perl
# This program allows a java Applet to write direct to a web server  #
# It is based on an article "Java Jive" by Scott Clark               #
$Fname = "e:/absolute/address/of/file/14.rst";
$SFC = "e:/absolute/address/of/file/savecount.dat";
# example "e:/domains/mydomain.co.uk/Stats/Under14.rst"
print "content-type: text/html\n\n";
# print content type header top the browser
if ($ENV{ 'REQUEST_METHOD'} eq 'POST'){
     read(STDIN,$datain, $ENV{ 'CONTENT_LENGTH'});
     open(SFC, $SFC) or die "Can't open Save Count File";
     $count = <SFC>;
     close(SFC);
     $Backup = substr($Fname,0,length($Fname)-3).$count;
     if (-e $Backup) {unlink($Backup); } # if the $Backup file exists, delete and then....
     rename($Fname,$Backup);            # rename current file to latest save file
     open(SFC,">$SFC");
     $count = $count+1;
     if ($count eq 1000){
          $count = 995;                 # change this number to 997 for 3 backup files
     }                                     # or 990 for 10 backup files
     print SFC $count;                   # increment the save file count
     close (SFC);     
     open(OUT,">$Fname") or die "Session not possible:$!";
     print OUT $datain;                   # write out the new data file
     print "*****  Data Transfer completed  *****";
close(OUT);
#close the filehandle
exit 0;
#exit the code
1; #return trueThe cgi file will keep a number of file copies for you. A note of caution. Anyone with access to your applet can update the file, and screw your data. Anyone contemplating this approach should be aware of that. This may not be the best approach for what you want to do. I may extend the cgi file to put in a password.... undecided yet.
Thanks for all the tips from the guys in the forum. Good Luck... KPJ

Similar Messages

  • Portlet Url writing with a Weblogic Server as WSRP Producer

    Hi there,
    I’m having problem to find out which API I have to use to make my producer write the URL using the consumer’s urlTemplate.
    I have a basic Struts portlet with two forward (to a JSP) actions, I need to find a way to use the urlTemplate from the consumer (I do receive the good SOAP message with those templates from the consumer) to make my producer re-write the url (href to next.do in a JSP).
    My consumer is running on a bea Weblogic Portal 8.1 and my WSRP (simple) producer on a Weblogic server 8.1
    I did not find any example in the whole bea documentation and I hope that some of you may have experienced it.
    Thank you.
    Joanny

    If you are using the correct version of Struts taglib, this rewriting
    should happen automatically. Can you check if the taglib tld points to
    com.bea. classes?
    Subbu
    Joanny CHRIST wrote:
    Hi there,
    I???m having problem to find out which API I have to use to make my producer write the URL using the consumer???s urlTemplate.
    I have a basic Struts portlet with two forward (to a JSP) actions, I need to find a way to use the urlTemplate from the consumer (I do receive the good SOAP message with those templates from the consumer) to make my producer re-write the url (href to next.do in a JSP).
    My consumer is running on a bea Weblogic Portal 8.1 and my WSRP (simple) producer on a Weblogic server 8.1
    I did not find any example in the whole bea documentation and I hope that some of you may have experienced it.
    Thank you.
    Joanny

  • URL writing and Cookie

    Can you use both methods for maintaing the session id in a web application.
    For example, use session id from the cookie in most cases and in some case use the id from URL and bind the request to session.
    Is it possible to do it ?

    If you take a look at the API http://java.sun.com/j2ee/1.4/docs/api/index.html for javax.servlet.http.HttpServletResponse.encodeURL()
    it says the following
    Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL
    unchanged. The implementation of this method includes the logic to determine whether the session ID
    needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is
    turned off, URL encoding is unnecessary.
    For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise,
    URL rewriting cannot be used with browsers which do not support cookies.Thus it will ONLY add the id from URL if it detects that the browser does not support cookies.
    Cheers,
    evnafets

  • Sessions, URL Rewriting, and Cookies

    First some background, then some questions:
              BACKGROUND
              I have written an application framework to use with JSP/EJB/Servlet
              based applications. This framework does URL rewriting
              (response.encodeUrl) for all URLs generated by the application, and I
              have URL-based session support turned on in WebLogic.
              Despite the fact that my browser is set to support cookies on my test
              machines, I have noticed that intermittently the URL rewriting to
              support session IDs kicks in. Then, later, it goes away again. This
              would seem to indicate that the client browsers are (for no apparent
              reason) deciding to occasionally not support sessions with cookies, so
              that the server has to step in and do URL writing instead.
              QUESTIONS
              1. Has this sort of behavior been reported by anyone else?
              2. Is there a servlet/JSP API anywhere that I can call on a per-HTTP
              transaction basis to see if the browser that is participating in the
              transaction is at that moment supporting cookies?
              3. There are times when my framework needs to delete a cookie by setting
              its maxAge to 0. Most of time time this works, but (as with the session
              ID/URL rewriting above) occasionall the cookie does not get deleted on
              the client brower machine. This screws up some of the application logic
              that I have in the framework. Is this related to the problems listed
              above?
              CONCLUSION
              Any and all information is appreciated, from anyone. Thanks!
              Chris
              

              Hi,
              To answer your question #1, yes I have seen this behaviour, and
              the explanation I feel is as follows.
              1] You access a resource on WL Server & it starts a session, at
              this moment it is not sure whether the browser supports cookies
              so it uses both methods, URL Writing & cookies to store the session
              ID
              2] On the next request, it tries to read the cookie, if it is able
              to read it that means cookies are enabled and there is no need
              to continue with URL Rewriting else it continues wioth URLRewriting.
              To answer Question #2, you can follow a procedure similiar to above
              to find out if browser supports cookies, ie set a cookie & in the
              next request try to read teh value.
              As far as Question #3 is concerned, try setting the magAge to -12
              hours insteda of 0 so that there is no problem even in case of
              a time difference.
              hope this helps
              Rahul
              Chris Dole <[email protected]> wrote:
              >First some background, then some questions:
              >
              >BACKGROUND
              >I have written an application framework to use with JSP/EJB/Servlet
              >based applications. This framework does URL rewriting
              >(response.encodeUrl) for all URLs generated by the application,
              >and I
              >have URL-based session support turned on in WebLogic.
              >
              >Despite the fact that my browser is set to support cookies
              >on my test
              >machines, I have noticed that intermittently the URL rewriting
              >to
              >support session IDs kicks in. Then, later, it goes away
              >again. This
              >would seem to indicate that the client browsers are (for
              >no apparent
              >reason) deciding to occasionally not support sessions
              >with cookies, so
              >that the server has to step in and do URL writing instead.
              >
              >QUESTIONS
              >1. Has this sort of behavior been reported by anyone else?
              >
              >2. Is there a servlet/JSP API anywhere that I can call
              >on a per-HTTP
              >transaction basis to see if the browser that is participating
              >in the
              >transaction is at that moment supporting cookies?
              >
              >3. There are times when my framework needs to delete a
              >cookie by setting
              >its maxAge to 0. Most of time time this works, but (as
              >with the session
              >ID/URL rewriting above) occasionall the cookie does not
              >get deleted on
              >the client brower machine. This screws up some of the
              >application logic
              >that I have in the framework. Is this related to the problems
              >listed
              >above?
              >
              >CONCLUSION
              >Any and all information is appreciated, from anyone. Thanks!
              >
              >Chris
              >
              

  • Getting producer resource URLs in a WSRP consumer

    I have 2 WebLogic 8.1 portal domains, a producer (ProducerDomain) and a consumer (ConsumerDomain). The producer domain has a portlet that displays an image that is local to the producer (i.e. http://localhost:7001/ProducerDomain/images/image.jpg). The consumer portal then creates a remote portlet of this producer portlet, and the end result should be that the consumer application should see the image that is local to the producer in its remote portlet.
    The problem is, I can't figure out how to create the URL to the image on the producer side in such a way that the consumer can see the image. I have tried the following in my producer portlet:
    <render:resourceUrl var="theURL" path="/images/Sunset.jpg" />
    img1 = <img src="<%=theURL%>">
    img2 = <img src="<%=request.getScheme()%>://<%=request.getServerName()%>:<%=request.getServerPort()%><%=request.getContextPath()%>/images/Sunset.jpg">
    The img2 URL works fine, because it simply gets the producer URL and hard codes that into the img tag. However, this doesn't seem like the right way to be URL writing in WSRP. The resulting values in the consumer remote portlet are the following:
    img1 = <img src="http://localhost:7011/ConsumerApp/resource;jsessionid=GRVL8lVvxvlY8Wj1JGzXSkJ6hJGRM0WhjnkKh5HZLT0wJbygZGYQ!1580368832?_windowLabel=portlet_1_1_1&wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A7001%2Fimages%2Fimage.jpg&wsrp-requiresRewrite=false">
    img2 = <img src="http://localhost:7001/ProducerApp/images/image.jpg">
    img2 works fine, but img1 does not. I think I'm missing something in the way I should be creating this URL. If anyone has any ideas, they would be greatly appreciated!
    Thanks.

    Anyone have any ideas on how to get this working correctly? I've already read through the following document:
    http://dev2dev.bea.com/pub/a/2005/02/urls_in_portal.html
    But I can't seem to see any concrete examples on how to get this case to work.

  • Session getting lost between JSPs

    Hi,
    I am working on a application in which a user can upload files using FTP. The files may be of large size, say 50-100 MB and it takes approx 30-60 mins for such uploads. The session timeout for the website is set to 20 mins. The way it works is, from the main browser window there is a link to upload files. This link opens a popup window and through this window the user can upload a file. In this popup window, i have included an iframe which sends a post request to the server every 10 mins to keep the session alive. This is working fine in most of the cases, but sometimes it happens that when the when a call is made to send a post request to the server from the iframe, the session is becoming null & invalid or this happens also after the upload has finished and the "upload successful" page gets loaded. This is a very random behaviour, sometimes it works perfectly fine and sometimes it doesn't. It is not dependent on the time, or the size of the file or the number of times the iframe has submitted the request to the server.
    Any one has any idea why the session is becoming null randomly?

    Hi,
    This should never really happen when you bring up a Web Server or to what so called a loadbalancer in place as ultimately the container which creates the session Object.
    I strongly feel that the Webserver(Apache,Sun App Server or IIS) is not passing on the jessionid cookie value which is actually responsible for this action when we are not using url writing for maintaining. .
    How do test that ??
    try the below code snippet and the rest all is understood on what values you get.
    <%
       //Get the values of respective Properties
       boolean sessionIdFromCookie = request.isRequestedSessionIdFromCookie();
       boolean sessionIdFromUrl = request.isRequestedSessionIdFromURL();
    %>
    From Cookie : <%=sessionIdFromCookie%>
    From URL : <%=sessionIdFromUrl%>Well to sort out problems as these you got to enable passing of jsessionid cookie to the Application Context via Webserver which might call for additional set of configurations from webserver end and AJP part.
    Just as an example let us consider in the case employing IBM http server
    http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.doc/info/aes/ae/xjta_ihs_int.htmlor a neutral way to fix this issue is to adopt usage of a technique called URLREWRITING.
    How do you do that ??
    A quick google search provided me the below results
    http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.admin.doc/tasks/tseurlrewrite.htm
    http://www.adventnet.com/products/qengine/help/load_testing/loadscript_creation/recording_bc/url_rewriting.html
    http://java.boot.by/wcd-guide/ch04s04.htmlHope this might help :)
    REGARDS,
    RaHuL

  • IE6 and HttpSession

    My JSP's/Servlets use simple HttpSession objects that expire when the browser is closed. It is my understanding that if a browser has cookies disabled that URL rewriting is used. I've been testing in IE6 and when cookies are restricted all my session objects are all null. So it appears URL writing isn't occuring.
    Is there anything I have to do to 'turn on' URL rewriting? Any other suggestions?

    Hi Jason,
    Read this:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293222
    http://support.microsoft.com/support/kb/articles/q293/2/22.asp?LN=EN-US&SD=gn&FR=0&qry=cookie&rnk=10&src=DHCS_MSPSS_gn_SRCH&SPR=IE600
    --Paul                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Working in firefox, but throwing up errors in IE related to null objects

    firefox has no problems with my very simple spry data example but IE throws up the following errors, can anyone help?
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; InfoPath.2)
    Timestamp: Thu, 9 Sep 2010 17:31:34 UTC
    Message: 'Spry.Debug' is null or not an object
    Line: 961
    Char: 41
    Code: 0
    URI: file:///C:/Users/Gabriel/Documents/My%20Dropbox/GFA/website/dev/friedmanstudios.ca/SpryAss ets/SpryData.js
    Message: 'Spry.Data.initRegionsOnLoad' is null or not an object
    Line: 4855
    Char: 65
    Code: 0
    URI: file:///C:/Users/Gabriel/Documents/My%20Dropbox/GFA/website/dev/friedmanstudios.ca/SpryAss ets/SpryData.js

    in my header:
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
    <script type="text/javascript">
    var ds1 = new Spry.Data.XMLDataSet("GFAWORKS.xml", "dataroot/GFAWORKS");
    var ds2 = new Spry.Data.XMLDataSet("GFAWORKS.xml", "dataroot/GFAWORKS");
    </script>
    within a script tag near the end
    Spry.$$(".RowContainer").addEventListener("click", function(){ alert("clicked!"); }, false);
    earlier on in the body:
      <div spry:repeat="ds2" class="RowContainer">
        <div class="RowColumn">{Name}</div>
        <div class="RowColumn">{Type}</div>
        <!-- test for url writing -->
        <div class="RowColumn"><a href="{Code}.html">project link</a></div>
        <div class="contentPlaceholder"> </div>
      </div>

  • Session (attribute) lost between JSPs

    Hi All
    I've seen many post about losing the session but all of them (the ones I've seen) are different.
    Anyway, I have 3 jsp's, the first only submits a form like
    <FORM METHOD=POST ACTION="SaveName.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20>
    <P><INPUT TYPE=SUBMIT>
    </FORM>The second one stores the username in the session like
    <%
       String name = request.getParameter( "username" );
       session.setAttribute( "theName", name );
    %>
    <HTML>
    <BODY>
    Your name is <%= session.getAttribute( "theName" ) %><br/>
    <A HREF="NextPage.jsp">Continue</A>
    ....So far everything works fine!
    Then, when I click on continue the third jsp is reached:
    <HTML>
    <BODY>
    Hello, <%= session.getAttribute( "theName" ) %>
    </BODY>
    </HTML>This is only basics, but the last jsp shows 'null' instead of the name.
    I'm runnint tomcat6 behind apache. The only thing added to the apache configuration was
    ProxyPass /tomcat/ ajp://localhost:8010/Maybe I need to do more configuration ? Any suggestions ?
    Thnx
    LuCa

    Hi,
    This should never really happen when you bring up a Web Server or to what so called a loadbalancer in place as ultimately the container which creates the session Object.
    I strongly feel that the Webserver(Apache,Sun App Server or IIS) is not passing on the jessionid cookie value which is actually responsible for this action when we are not using url writing for maintaining. .
    How do test that ??
    try the below code snippet and the rest all is understood on what values you get.
    <%
       //Get the values of respective Properties
       boolean sessionIdFromCookie = request.isRequestedSessionIdFromCookie();
       boolean sessionIdFromUrl = request.isRequestedSessionIdFromURL();
    %>
    From Cookie : <%=sessionIdFromCookie%>
    From URL : <%=sessionIdFromUrl%>Well to sort out problems as these you got to enable passing of jsessionid cookie to the Application Context via Webserver which might call for additional set of configurations from webserver end and AJP part.
    Just as an example let us consider in the case employing IBM http server
    http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.doc/info/aes/ae/xjta_ihs_int.htmlor a neutral way to fix this issue is to adopt usage of a technique called URLREWRITING.
    How do you do that ??
    A quick google search provided me the below results
    http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.admin.doc/tasks/tseurlrewrite.htm
    http://www.adventnet.com/products/qengine/help/load_testing/loadscript_creation/recording_bc/url_rewriting.html
    http://java.boot.by/wcd-guide/ch04s04.htmlHope this might help :)
    REGARDS,
    RaHuL

  • DVD of PDF Portfolio

    I am making a PDF Portfolio. Within this portfolio I have one main document that has a lot of links to audio files, other pdf documents, powerpoint presentations, videos, websites etc. However once I save the portfolio and open the document on another computer or open it from an email attachment these links become cut. How can I overcome this issue as I want to burn this PDF Portfolio onto a DVD with all links intact.
    I would appreciate any help in solving this.

    A PDF Portfolio is designed to avoid these problems by being self-contained; but links to local non-PDF files are not supported (you can place non-PDF files into a Portfolio, but a link annotation on a page cannot have a destination within another non-PDF file).
    In addition, the file and folder structure on disk is not retained when files are added to a Portfolio, so all intra-document links must be recreated after assembly. For example:
    PDF1 contains a link to PDF2, both of which are in the same folder on disk:
    Writing both files to DVD and keeping them in the same folder, the link will still work.
    Placing PDF1 and PDF2 into a Portfolio, the link fails and must be re-created using the Link Tool.
    PDF3 contains a link to an external website (URL):
    Writing the file to DVD or placing it into a Portfolio, the link will still work.

  • Authenticate users via email

    This is the problem:
    i want to send a URL to visited by a user, so that after doing that, he's authenticated by the system.
    This is like some of most used web phorum work.
    How can i solve this problem?
    where can i find examples?
    I think the problem is to generate dynamic URLs, one per each user to be authenticated...but maybe there are easier solutions..
    thanks!

    why not just email them something like the forum link here?
    like:
    http://www.cometomysite?reply=true
    then when the user clicks that link they'll be taken to the site on that page check the value of reply, if it's not there or not equal to true don't let them in. basically it's better to use something other then true or false, if you want send them some bizarre word or number. basically you will be using the URL to authenticate the user. here's something on it:
    http://javaboutique.internet.com/tutorials/JSP/part04/
    try searching on google for url writing with jsp servlets.

  • Where is HttpSession.setAttribute stored?

    I have a jsp that keeps count and is storing the info in a HttpSession object using the setAttribute method(The code is at the bottom). How does the server know I am the same client is before? I am just using http which is stateless. I also don't see any cookies transferring the data back. If I close and reopen, my browser, the incrementing starts all over again. Thanks for helping me understand this better.
    dean
    <%@ page errorPage="errorpage.jsp" %><html>  <head>    <title>Session Example</title>  </head>  <body>    <%      // get a reference to the current count from the session      Integer count = (Integer)session.getAttribute("COUNT");            if ( count == null ) {              // If the count was not found create one        count = new Integer(1);        // and add it to the HttpSession        session.setAttribute("COUNT", count);      }      else {         // Otherwise increment the value        count = new Integer(count.intValue() + 1);        session.setAttribute("COUNT", count);      }        out.println("<b>You have accessed this page: "        + count + " times.</b>");    %>  </body></html>

    also don't see any cookies transferring the data backHow do you say that? Have you checked it using some proxy tool or something?
    It's this way- if cookies are enabled on your browser, each time the browser requests a resource from the same webapp, the browser is sure to send the cookie back(if the server has put one). This won't be a persistent cookie i.e won't be stored on the disk in most cases. If you have proxy tool, yu can see that the browser submits a cookie by name JSESSIONID.
    If cookies are not enabled, url writing willb e used.

  • UrlRewriting by extending HttpServletRequestWrapper

    Hi,
    We were trying out several approaches for url writing in j2ee container. (I know apache's mod_rewrite is obvious choice if using apache). There are two approaches we were discussing
    1. Use RequestDispatcher.forward or RequestDispatcher.input methods (This approach is used by UrlRewriteFilter (http://tuckey.org/urlrewrite/))
    2. Override HttpServletRequest (all the methods like getUri, getServletPath etc) and make it appear like mapped uri.
    Are there any problems with approach 2? If we override methods like getUri, getServletPath etc, can it cause any issues.
    Thanks,
    Unmesh

    Please explain what you mean by "doesn't allow me to do it". Can you send the error you are seeing.

  • Using a Java Program to execute JavaScript from a website

    Okay, let me try and explain as good as I can. I have a program now, that searched through all files and folders in Unix (Solaris machine) and gets the list of files in the bin and sbin folders.
    Well, I want to find the version of each of these files from the bin and sbin folders and not all of them have the -v, -V or -version feature (or any others there may be). But, I found this page:
    http://sunsolve.sun.com/pub-cgi/fileFingerprints.pl
    where if you go to the page I can find an md5 number, place it in the box and click submit to find versions, if available.
    My thing is, as I find the number from my java program, I want to be able to open this page, insert in the box (or maybe even call the javascript function) and then submit to get the version numbers. That would mean I could need to get back info from the javascript function.
    I hope that explains what I need and hope that someone can help me.
    I have found information on the JSObject, but not sure what that means exactly so if someone can explain this:
    JSObject win = JSObject.getWindow(this);
    JSObject doc = (JSObject) win.getMember("document");
    JSObject loc = (JSObject) doc.getMember("location");
    String s = (String) loc.getMember("href"); // document.location.href
    win.call("f", null);     
    it would be greatly appreciated. But, this may not even be what I need. I see that the win.call is where I would call the function needed and I am guessing the null could be where I put the number if that is how the function i need works like that. But, what I dont understand is what "document" is and "location". Also, i the "href" the page I put above? I am just lost on that. Hope someone will understand.
    Thank again for the help!

    Exactly so. Check out the last item - reading and writing to a URL - writing to a URL.
    Pulling out the form code from that page:
    <FORM METHOD="POST"  ENCTYPE="application/x-www-form-urlencoded">
    <TEXTAREA NAME="md5list" ROWS=16 COLS=66 MAXLENGTH="33792"></TEXTAREA>
    <BR><INPUT TYPE="submit" NAME="submit" VALUE="submit">
    <INPUT TYPE="reset" VALUE="reset">
    </FORM>You should end up with something like this (copying and pasting from the example):
    URL url = new URL("http://http://sunsolve.sun.com/pub-cgi/fileFingerprints.pl");
    String sNumbers = "put your serial nos in this string"
    URLConnection connection = url.openConnection();
    connection.setDoOutput(true);
    PrintWriter out = new PrintWriter(connection.getOutputStream());
    out.println("md5list=" + sNumbers);
    out.close();
    BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
    String inputLine;
    while ((inputLine = in.readLine()) != null){
      // read in the HTML page result for later parsing?
    in.close();

  • URL Re-Writing

    Hi Guys,
    I'm interested in managing urls on incoming requests. For example, if someone clicks on a link that says, www.something.com or www.someone.com, I want them both to direct to the same page. I'm guessing I can do this from the web xml servlet mapping property, but I want to know if there are other ways of doing this.
    Also, I want to be able to re-write outgoing urls so they retain the names I want them to have. For example in my servlet I have something like;
    String address = "";
    address = "RetrieveUser.jsp";
    RequestDispatcher dispatcher = request.getRequestDispatcher(address);and then the code will display something like
    www.somethinglike.com/RetriveUser.jsp.
    However I want it to display,
    www.somethinglike.com/WhatIWant.htm
    how would I go about achieving this?

    What do you mean "the code will display something like" ? The code will contain whatever you write, you are writing the code, right or wrong. Are you referring to the url in the browser window?
    What are you trying to do
    Note that the RequestDispatcher is a server side redirect, so essentially the client is unaware. Calling the method "sendRedirect" of the response object causes the client to initiate a new get request and that will impact what appears in the browser window of the client. The RequestDispatcher will have no impact.

Maybe you are looking for

  • Optical Drive suddenly not working

    Last week my MacBook 1,1 refused to play DVDs. This week, it refuses to accept blank CD-R's for burning music on iTunes. In the past, i could usually just try another CD as some appear faulty to begin with, but now the problem is systematic. I tried

  • Closed captions not appearing

    I opened my captivate project in the trial version of captivate 6 and now the closed captions do not appear in the output. They worked in the 5.5. version. I ensured that all the appropriate CC settings in the Slide Audio and the Skin Editor are sele

  • Message Bridge - from Topic to Queue

    Hi all,           Can I set up a message bridge in Weblogic 8.1 sp3 to "redirect" message from a topic to a queue? i.e. The source is set to Topic while the target is to queue consumed by a MDB located in the same instance as the queue.           I t

  • Return of customer job work

    Hi gurus, i  have another scenario regarding return in customer job work, if a customer is sending us a material for painting we are taking that material as customer job work where we follow the following steps sales order--goods received of raw mate

  • Fan going into full blast for no reason

    the fan in my macbook has been going to 6000 rpm for no reason. like when im not doing anything, suddenly i hear the fans start spinning. usually, at 2500(min speed for my mb) rpm, it is barely audible. then suddenly i hear this low hum, and i look a