Resolving non http urls in JSP

When I include an html hyperlink in my JSP as follows :
Yahoo
then the hyperlink on the web page points to
http://www.yahoo.com
However if I write the hyperlink as
Yahoo
then the hyperlink on the web page is wrongly created as
http://<hostname>/www.yahoo.com
This seems to be an issue with the JSP engine. I am using weblogic.
Is there any way to resolve the non http urls?

This has nothing to do with the JSP engine.
<a href="www.yahoo.com">Yahoo</a> IS not a JSP tag and is not touched by the JSP engine.
The problem you have is just your WEBBROWSER interpreting the url wrongly mainly becasue you have forgotten to provided the protocol your webbrowser has to use.

Similar Messages

  • Convert file url to http url in jsp

    Hi, is there a way to convert file url (file:/opt/test/test.pdf) to http url? I have tried so hard and still stuck on it. Please give help. Thanks in advance!

    I found another solution to dispaly my pdf file on browser without storing the pdf file to application real path. My application generated PDF file and stored it to some place like /opt/report/**.pdf. Then define ContentType("application/vnd.fdf"), use java InputStream and outputStream to operater file.
    I deeply appreciate the help from everyone in this forum. I hope my solution could help someone who have the problem like me.
    Here is the code:
    response.setContentType("application/vnd.fdf");
    File f = new File(filename);
    DataInputStream dis = new DataInputStream(new FileInputStrea(filename));
    OutputStream osout = response.getOutputStream() ;
    int data=0;
    long count=f.length();
    try
    while(count !=0)
    data = dis.readByte();
    osout.write(data);
    count--;
    }catch(Exception e)
    System.out.println(e.toString());
    dis.close();
    osout.flush();
    osout.close();

  • SQL Server 2012 Reporting Services Report Manager using non-HTTPS URLs on part of site

    For potential ease of understanding, I am seeing the same issue as this person
    here.
    Currently, my site is successfully using HTTPS in all areas of the /Reports site, with a single exception. If you drill down to a report and go to "Manage", the following links are all http://, not https://:
    Parameters
    Data Sources
    Subscriptions
    Processing Options
    Cache Refresh Options
    Report History
    Snapshot Options
    Security
    These remain regardless of the configuration combinations I enter in Reporting Services Configuration Manager. I'm not sure what makes this part of Report Manager special. Even if I only enable https in the Report Manager URL settings, these links all stay
    as http (port 80). I can find no references in config files to this.
    Any assistance is welcome. Obviously having non-encrypted links is not acceptable.

    Hi SteveKSM,
    According to your description, you specify the report manager URL as https://. When you open the child items on report manager, the URL change to the http://.
    In your scenario, since you want to set SSRS to require all SSL connections, you need to change the SecureConnectionLevel value to 3 in RSReportServer.config file (located in C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer).
    It means that all communication must use secure connections. So please specify this attribute like below:
    <Add Key="SecureConnectionLevel" Value="3"/>
    Reference:
    Configuring the Report Server for SSL Communication and Internet Deployment:
    https://msdn.microsoft.com/en-us/library/cc304416.aspx
    Report Manager Links with SSL
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • How to read XML file kept on NON-SAP server using the Http URL ?

    Dear Experts,
    I am working on CRM2007 web UI. I need to read a XML file placed on a shared server location by a third party program. Then process that XML file into CRM and create a quotation using the data extracted from the file.
    All i have with me is the http URL that points to the location of the file.
    I am supposed to read the file , create quotation and at later point of time i would be asked to update the quotation and then generated new XML representing updated quotation and replace the XML file on shared server location with this new updated XML file.
    I know how to extract data from XML file into ABAP but i have no clue as to how to access the file on some other server using the http url i have and how to read it ?
    I searched on the forum and i found the codes for reading XML file that is located either on client machine OR on the Application server wheareas my file is on some other than sap application server.
    Please help me as its an urgent issue .
    Points will be rewarded for sure.
    Please help.
    Thanks in advance,
    Suchita.
    p.s. : the http url to the file location is like -->
    http://SomeServerDomain/SomeDirectory/file.xml

    hi,
    interesting task.
    to request the file by a http call you need to create an if_http_client object.
    More info is [here|http://help.sap.com/saphelp_nwmobile71/helpdata/en/e5/4d350bc11411d4ad310000e83539c3/frameset.htm]
    to parse the file you either have to work with the ixml packages ([info|http://help.sap.com/saphelp_nwmobile71/helpdata/en/47/b5413acdb62f70e10000000a114084/content.htm]) or you use an XSLT transformation ([info|http://help.sap.com/saphelp_nwmobile71/helpdata/en/a8/824c3c66177414e10000000a114084/content.htm]).
    uploading the final file isn't so easy. if you only have http, you should write a server script to allow uploading of the new file and copying it into the place of the old file. but you definitely need the script.
    now it's your take. depending on how experienced you are in ABAP and networking this might turn out to be easy or pretty complicated.
    have fun,
    anton

  • Help!!!.....HTTP Post to JSP with parameters in URL also....

    I am trying to emulate a webpage that is POSTing info to a URL which is a JSP that also has parameters in the URL. I am having problems getting my java code to emulate doing this task manually through a web browser.
    The webpage has the following HTML code:
    <form method=post action=hello.jsp?y=60245&x=698>
    <input type="text" name="name" value="jim">
    <input type=submit name=submit value="Now">
    </form>
    ...notice that the jsp referenced above has some parameters appended to the url, but the method is post.
    Here's my code to try to do the same thing as if I manually pressed the submit button in a browser:
    URL url = new URL("hello.jsp?y=60245&x=698");
    httpConnection = (HttpURLConnection)url.openConnection();
    httpConnection.setRequestMethod("POST");
    httpConnection.setDoOutput(true);
    httpConnection.setDoInput(true);
    httpConnection.setUseCaches(false);
    httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    DataOutputStream output = new DataOutputStream(httpConnection.getOutputStream());
    output.writeBytes("name=jim&submit=Now");
    output.flush();
    BufferedReader is = new BufferedReader(new InputStreamReader(httpConnection.getInputStream()));
    Writer w = new BufferedWriter(new FileWriter("CapturedHTML.html"));
    int data=0,count=0;
    while(data!=-1){
          data = is.read();
          w.write(data);
          count++;
    System.out.println(count + " bytes read");
    w.flush();
    w.close();
    is.close();
    output.close();I write out the result to a file so that I can see the HTML returned by the JSP. It's a completely different webpage than if I were to have manually clicked the submit button on a browser.
    WHY???????? How is a browser actually sending the info to the jsp when it has info both in its URL and in the post data?

    I might be wrong, but the browser could have some sort of mechanism built into it which makes sure that the parameters appended to the url are actually passed as a part of a POST requst, while a Java program might not pass them at all.
    Have you tried passing these params: y=60245&x=698 as a part of a POST request, rather than adding them to the URL.
    Also, how do u know which response from JSP is correct? They might be different but do u know which one is the correct one? Do you know what the response should look like? that would make things a lot easier as u could figure out what parameters are causing the differences in the responses u r getting.

  • Clean URLs with JSP/Servlet

    Hello. I've found some information on how to setup clean URLs for php, but none for JSP/servlet. Hopefully some one can help. Here's what I mean by 'clean URL':
    http://mydomain/employee.jsp?employeeID=1232
    becomes
    http://mydomain/employee/1232
    And, in that second example, the container would dispatch all requests for /employee* to some JSP/servlet. I don't care if the 'clean URL' has to have an extension or not (e.g. mydomain/employee.jsp/1232) although I would prefer to also remove the JSP extension.
    Additionally (if some one has experience with this need): how do I then access the final part of the URL supplied by the client? In other words, how would 1232 be available to the destination JSP/servlet? Does the container convert it into a parameter, i.e.:
    1) client sends request for "mydomain/employee/1232"
    2) container delegates request to "mydomain/employee.jsp?1232"
    Finally (sorry about the length), I don't have access to top-level config files for this site (it's personal use, although I'm pretty familiar with java APIs from my job), so, ideally, I'd like a .htaccess level solution, where the container can just re-route to a JSP.
    If any one has some suggestions, I'd GREATLY appreciate it. Thanks for your time. Take care.

    ...Just occurred to me- this hosting company is NOT using Tomcat. They use resin.
    Thanks.

  • How to launch a non bsp url through transaction launcher

    Hi All,
    i am not able to launch a non bsp url from transaction launcher. i have followed all the steps needed.
    Defined URL as non bsp url and defined the logical system and assigned it to rfc destination.
    when i test this out, i am getting a blank page.
    Any pointers on this will be helpful.
    Thanks,
    Udaya

    I am trying to launch sap/bc/bsp/sap/ytest2/index.htm without giving the initial server details. for the server details, i have mapped to logical system.
    i am assuming that this will pick the server info http://dmsap650.fm.test.com:8006/.

  • [CS3 JS SDK] Possible to Use HTTP URLs for Links?

    I am attempting to use JavaScript to implement a connector from CS3 (InDesign/InCopy in my case) to our content management system. Our CMS provides an HTTP-based API. By using the HttpConnection object (from the Bridge code, see posts on "httpwebaccess library") I can access our repository using HTTP URLs and, for example, get an InDesign document or INX file (and the UI support in CS3 scripting makes it possible for me to build all the UI components I need without having to write a true plugin).
    However, what I *can't* seem to do is create Link objects that use a URL, rather than a File, to access resources.
    My goal is to be able to store in our repository InDesign documents that use URLs to other resources in the repository for links (e.g., to graphics and InCopy articles).
    However, as far as I can tell from the scripting documentation and my own experiments, the URL property on Link is read-only in JavaScript (even though the scripting API HTML indicates it's a read/write property) and Link instances can only be constructed using File objects.
    My question: have I missed some trick in the scripting API (or elsewhere) that would allow me to create links that use URLs instead of files (and having done so would InDesign resolve those URLs?)? Our repository does support WebDAV, so that might be an option, but it would depend on mounting WebDAV services in consistent places on client machines, which is dicey at best, given the weak nature of the WebDAV clients on both Windows and OS X).
    Or are my only options to either copy linked resources to the client's local file system (or a shared network drive) or implement a plugin that implements my desired behavior for links?
    And if the answer is a plugin, will that even work?
    This is in the context of CS3. Has the Link mechanism changed at all in CS4 such that I could do what I want in CS4 where I cannot in CS3?
    Thanks,
    Eliot

    Hi,
    It is not possible to use HTTP URLS in CS3. You will have to create a plug-in to use Custom Data Links.
    I think it is possible to use HTTP URLs in CS4 as per the User Guide.
    Regards,
    Anderson

  • Security error: Cannot authorize operation for invalid non-ASCII URL

    I have an error that popped up with Flash Player 10.1.85.3 or 10.1.82.76.
    In our application, we load users' avatars with their original filename. Some filenames have non-ASCII characters (i.e. Hebrew, accents, or umlauts) and I can no longer load those files from a different subdomain.
    For example, I'm trying to load this image (with the Loader class and a LoaderContext):
    http://photos.myawesomedomain.com/images/awesöme.jpg  (o with umlaut)
    It comes to me encoded in UTF-8:
    http://photos.myawesomedomain.com/images/awes%C3%B6me.jpg  (umlaut converted to %C3%B6)
    When I try to load the file from http://myawesomedomain.com/myawesome.swf, I get this error:
    *** Security Sandbox Violation ***
    Connection to http://photos.myawesomedomain.com/images/awesöme.jpg halted - not permitted from http://myawesomedomain.com/myawesome.swf
    Error: Cannot authorize operation for invalid non-ASCII URL http://photos.myawesomedomain.com/images/awesöme.jpg
    If I try this with a player earlier than 10.1.82.76, it works. It also works if I move the file to the same domain as the SWF (http://myawesomedomain.com/images/awesöme.jpg) -- but that's not an option for me. Files without unusual characters work regardless of the player version.
    The error occurs when I try to access the bitmap data of the loaded image. I've tried encoding the URL differently, but Flash always reports it as "http://photos.myawesomedomain.com/images/awesöme.jpg" - with the umlaut converted to strange characters. The cross domain file allow-access-from "*.myawesomedomain.com"
    Has anyone run into this? Is there a way I can fix it without renaming the users' photos (we have tens of thousands of these)?
    I feel like I must be missing something obvious; hardly anything comes up in Google for this, but I don't think it would be an uncommon problem.  I believe https://bugs.adobe.com/jira/browse/FP-5580 is related.
    Thanks!

    The problem is based on the player version, not the browser.
    The problem showed up in Chrome first because it auto-updates the player; when Firefox users installed the updated player, they started having the problem, too.

  • Accessing external web service with non-constant URL

    Hello, all
    I am looking in the documentation on accessing external web services, but either I am looking in the wrong place, or the documentatoin is lacking info.
    My clients have several web services in the local network (regular services, not DB-based), the have the same interface, but different URL's.
    Versions of the DB are 11, 12, and 16.
    First of all, I do not see in the specs an option for a non-hardcoded URL. The logic says that this has to be possible, but I cannot find it.
    Second, I need to see an example of accessing an XML or JSon based service, I cannot find it in the specs either.
    Can anyone point me to a document with examples?
    Thank you
    Arcady

    The following will call a web service with whatever URL you pass in as the argument "myurl".  I think that is what you are looking for.
    CREATE PROCEDURE cli_test2( myurl LONG VARCHAR )
    RESULT( httpheaders long varchar, httpvalues long varchars
    URL '!myurl'
    To deal with the resulting data in XML, use the OPENXML() function.
    eg. To turn an XML list of employees that looks like this:
    <root>
    <row EmployeeID="102" Surname="Whitney" GivenName="Fran" StartDate="1984-08-28"/>
    </root>
    into a table of results, you would do this (where xmlgetemplist() is the web service call):
    CREATE OR REPLACE PROCEDURE xmlgetemplist() RESULT( httpheader long varchar, httpbody long varchar)
    URL 'http://localhost/demo/xmlEmployeeList'
    TYPE 'HTTP:GET';
    create variable res long varchar;
    -- call the web service
    select httpbody into res from xmlgetemplist() where httpheader = 'Body'
    -- extract the XML elements into a SQL result set
    select * from openXML( res, '/root/row' ) WITH ( EmployeeID INT '@EmployeeID',
           GivenName    CHAR(20) '@GivenName',
           Surname      CHAR(20) '@Surname',
           PhoneNumber  CHAR(10) '@Phone');
    To deal with the resulting data in JSON, use the sp_parse_json() procedure.
    eg.
    To turn a JSON formatted list of employees that looks like this:
    "EmployeeID": 102,
    "Surname": "Whitney",
    "GivenName": "Fran",
    "StartDate": "1984-08-28",
    "TerminationDate": null
    into a table of results, you would do this (where jsongetemplist() is the web service call):
    CREATE OR REPLACE PROCEDURE jsongetemplist() RESULT( httpheader long varchar, httpbody long varchar)
    URL 'http://localhost/demo/jsonEmployeeList'
    TYPE 'HTTP:GET';
    create variable foo long varchar;
    --call the webservice
    select httpbody into foo from jsongetemplist() where httpheader = 'Body';
    --turn the json result into a structured array of data
    -- this step is required because of less structured nature of JSON
    call sp_parse_json( 'output_array', foo);
    --extract the JSON elements from the output array into a SQL result set
    SELECT  output_array[[row_num]].EmployeeID as EmployeeID,
                   output_array[[row_num]].SurName as SurName,
                   output_array[[row_num]].GivenName as GivenName,
                   output_array[[row_num]].StartDate as StartDate,
                   output_array[[row_num]].TerminationDate as EndDate
    FROM sa_rowgenerator(1, CARDINALITY(output_array))
    Hope this helps,
    --Jason

  • Accessing https url EBS R12.1.3 leads to "Internet Explorer cannot display the webpage"

    Hi all,
    DB:11.2.0.3.0
    EBS:12.1.3
    O/S:Solaris SPARC 64 bits
    I.E Browser: 9.0
    Problem Description
    Cloned target database TEST1 from source database TEST2 RMAN full backup. But on accessing https url EBS R12.1.3 leads to "Internet Explorer cannot display the webpage"?
    Autoconfig completes successfully on both DB and Apps Tier and have also ran ojspcompile but still the same issue.
    $ perl ojspCompile.pl --compile --flush -p 2
    logfile set: /t000/test1/inst/apps/TEST1_Hostname/logs/appl/rgf/ojsp/ojsp
    starting...(compiling all)
    using 10i internal ojsp ver: 10
    synchronizing dependency file:
      loading deplist...8095
      enumerating jsps...8095
      updating dependency...0
    initializing compilation:
      eliminating children...6024 (-2071)
    translating and compiling:
      translating jsps...6024/6024 in 7m50s
      compiling jsps...6024/6024 in 35m17s
    Finished!
    Bounced the services there after still the same issue. Could anyone please share the fix if encountered such an issue before.
    Thanks for your time,
    user10088255

    Apache logs have the below entry:
    [Sun Oct 27 02:30:11 2013] [notice]  configured -- resuming normal operations
    [Sun Oct 27 02:30:11 2013] [notice] Accept mutex: fcntl (Default: fcntl)
    [Sun Oct 27 03:03:02 2013] [notice]  configured -- resuming normal operations
    [Sun Oct 27 03:03:02 2013] [notice] Accept mutex: fcntl (Default: fcntl)
    [Sun Oct 27 04:04:59 2013] [notice]  configured -- resuming normal operations
    [Sun Oct 27 04:04:59 2013] [notice] Accept mutex: fcntl (Default: fcntl)
    [Sun Oct 27 04:29:54 2013] [notice]  configured -- resuming normal operations
    [Sun Oct 27 04:29:54 2013] [notice] Accept mutex: fcntl (Default: fcntl)

  • Get Gateway name / url via JSP

    Anyone say what is the method to get the Gateway name / url via JSP?
    Thanks
    Fausto

    Alex, in the normal case you have reason the client host is the gateway host.
    A simple code:
    <%
    InetAddress inet = InetAddress.getByName( request.getRemoteHost() );
    String gateway = inet.getHostName();
    String portal="http://" + gateway + "/portal/dt";
    gateway="https://" + gateway + "/";
    String url=request.getParameter("url");
    if ( url != null) {
    response.sendRedirect(gateway + url);;
    }else{
    responde.sendRedirect(gateway + portal);
    %>
    I put a jsp in the web container, I contact the jsp trough an url
    http://www.mydomain/portal/desktop/redirect.jsp without the method get for the url variable, if I call the jsp directly without gateway from my client the gateway variable is my dns hostname and the jsp cannot redirect my in the portal login page
    If I take the localhost, it works fine but if a particular case when the gateway and the platform are the same host.
    There is not a HTTP enviroment variable to get the gateway name or a simple java method to ask the correct host?
    Thank you again
    Fausto
    http://www.mydomain/portal/desktop/redirect.jsp
    i

  • Xcode updates not caching in Caching Server - non-whitelisted url denied.

    I am running OS X Server 2.2.1 - Build 169.  (Mountain Lion).  I have the caching service enabled and it appears to have been working successfully - as I can see that updates from Apple are coming from my server when applied to multiple Macs.
    There is a new update to XCode 4.6.3 that I have been applying to my Macs - and I am noticing that it is re-downloading from Apple each time - instead of using the cache.
    If I look at the Caching Service log - I see an error for each time that I have applied the 4.6.3 update:
    Request for non-whitelisted URL denied (http:10.0.x.x:50360)   (10.0.x.x is my my server)
    HTTP Server:  Error 400 - Bad Requst (/)
    Is this a problem with the caching server - or are Apple's developer tools intentionally not being cached?  The log does not tell me what url is being requested.

    I have this exact problem too. Interestingly, I have this on my Mini server, then I've setup a caching server on my MacBook Pro and its the same. This log is from my MacBook Pro, its called badgerbookpro.local but its the same on the Mini server. Both are runing 10.8.3
    Jun  1 01:34:22 badgerbookpro.local AssetCache[4811]: Caching server started
    Jun  1 01:34:25 badgerbookpro.local AssetCache[4811]: Registration succeeded.  Resuming server.
    Jun  1 01:37:02 badgerbookpro.local AssetCache[4811]: Request for non-whitelisted URL denied (http://192.168.1.48:62249/)
    Jun  1 01:37:02 badgerbookpro.local AssetCache[4811]: HTTP Server: Error 400 - Bad Request (/)
    Jun  1 01:38:23 badgerbookpro.local AssetCache[4811]: Request for non-whitelisted URL denied (http://192.168.1.48:62249/)
    Jun  1 01:38:23 badgerbookpro.local AssetCache[4811]: HTTP Server: Error 400 - Bad Request (/)
    Jun  1 01:43:51 badgerbookpro.local AssetCache[4811]: HTTPConnection[0x7fdc04b1b900]: responseHasAvailableData: - Sender is not current httpResponse
    Jun  1 01:44:46 badgerbookpro.local AssetCache[4811]: Request for non-whitelisted URL denied (http://192.168.1.48:62249/)
    Jun  1 01:44:46 badgerbookpro.local AssetCache[4811]: HTTP Server: Error 400 - Bad Request (/)
    Jun  1 01:45:05 badgerbookpro.local AssetCache[4811]: Request for non-whitelisted URL denied (http://192.168.1.48:62249/)
    Jun  1 01:45:05 badgerbookpro.local AssetCache[4811]: HTTP Server: Error 400 - Bad Request (/)
    Jun  1 02:51:24 badgerbookpro.local AssetCache[4811]: Request for non-whitelisted URL denied (http://192.168.1.48:62249/)
    Jun  1 02:51:24 badgerbookpro.local AssetCache[4811]: HTTP Server: Error 400 - Bad Request (/)
    Jun  1 03:55:04 badgerbookpro.local AssetCache[4811]: Server shutting down (15)
    Jun  1 03:55:04 badgerbookpro com.apple.launchd[1] (com.apple.AssetCache[4811]): Exited with code: 15

  • OS X10.4.11 update, Safari won't connect to secure (HTTPS) URLs

    Didn't find any discussion of this particular symptom of the update, so thought I'd ask.
    Installed 10.4.11 update over the weekend, which contained Safari v3.0.4. After the (uneventful) install and reboot, I'm unable to connect to any secure (HTTPS) URL. Browser seems to work on non-secure connections (HTTP). My FIREFOX browser on the same machine still works.
    Haven't experienced any crashing or other OS issues, only the "Can't make a secure connection" with Safari (so far).
    Suggestions would be appreciated.

    Did you recently install the latest Security upgrade, but did not "repair permissions" on the restart? If so, that's your answer. I have found it essential to "Repair permissions" before and after any Apple system update, or Security update. Otherwise oddities may appear in the operating system.
    Also, sometimes reapplying the Combo Update specific to your current version of OS X remedies these types of problems. Here too, it's important to "repair permissions" etc.

  • Non-HTTP(S) Servlets

    I'd like to use servlets to provide services over a non-HTTP protocol (e.g. FTP, NNTP, SMTP, etc.). The existence of the Servlet -> GenericServlet -> HTTPServlet hierarchy suggests this is supposed to be possible but I'm not sure how to do it. The main problem I see is getting my servlet container to know what protocol (IP port) I want to use.
    So, are non-HTTP servlets supposed provide their own logic to set up a socket listener in the Servlet.init() method, manage their own thread pool, and dispatch requests to servlet instances as they are received? Or, is there some service provider API I can use to plug a non-HTTP service into my servlet container?
    BTW, I'd like to do this in a J2EE v1.3 server.
    Thanks, Dave

    I'd like to use servlets to provide services over a
    non-HTTP protocol (e.g. FTP, NNTP, SMTP, etc.)My first reaction would be "don't".
    In an HTTP request, there is a bunch of headers, which the servlet container uses to decide which servlet it will invoke. There are no such headers in e.g. FTP. Even if you manage to subclass Servlet to FTPServlet, the web server doesn't know how that FTP requests should be routed to that servlet.
    The piece of code that listens to port 80 etc really wants to see "GET", "POST" etc plus an URL on the first line of incoming data. That code won't respond well to seeing SMTP's "HELO".
    That being said, you can put such protocols in a web server or app server. Write a thread that creates a server socket for the appropriate port and then sits in accept(). When a connection comes in, it starts a new per-client thread which talks SMTP or whatever over the incoming socket. Pretty basic client/server socket programming.
    Also, to me, the servlet model appears inappropriate for FTP et al: a servlet services one request, then exits. FTP, NNTP and SMTP are all more like a discussion than request-reply.
    In theory, it would be possible to fashion e.g. an SMTP server as a sort of a servlet. Instead of doGet() and such perhaps you'd have doHELO(), doMAIL_FROM(), doDATA() etc. But that seems overly complicated... Seems easier to me to do simply:
        while (true)
            read socket input a line at a time;
            if (in data mode) {
                check for end-of-message;
                append to string buffer;
            } else {
                tokenize it;
                obey the incoming command;
        }Maybe if you really want to use the servlet model, write a Servlet-like class that has a doCommand() method and make the "obey the incoming command" bit above call that. I'm not sure how much that buys, though. There are enough small differences in things like command tokenizing to make code reuse in the various protocol "servlets" difficult.
    Btw, FTP in particular is an incredibly messy protocol. Implement that one only if you absolutely must, and even then crib some existing public domain implementation as a base. Active/passive, separate command/data channels, a wide range of buggy FTP clients, security difficult to get right, ... ouch...

Maybe you are looking for

  • How to change standard text in portal

    How to change standard text in portal Pls reply

  • 80 gb ipod will play my videos but there is no sound

    i read the answer to why it doesnt have sound and the solution to the answer and someone said that i have to use a different converter so i chose one from the ones that this one guy listed on this forum but after that how do i transfer the video from

  • Hotspot access violation running Eclipse JBoss IDE 1.6.0 & 2.0.0 on Win XP

    I have the following error when I try to open the Eclipse JBoss IDE versions 1.6.0 and 2.0.0 Beta. I tryed with jdk 1.5.0_06 and 1.5.0_12. Please, help me. # An unexpected error has been detected by HotSpot Virtual Machine: # EXCEPTION_ACCESS_VIOLATI

  • How to include certain shared fonts (AS2 on CS3)

    Hey everyone, I have a project which uses three different embedded fonts within it across a number of different swfs. As a result i have a separate fonts.swf file which contains the fonts and then i share them (so as not to have to load them within e

  • Custom pagination of rich:datascroller

    Hi, I am currently using the default implementation that is used by the <rich:datascroller to perform pagination on the <rich:scrollableDataTable using the following code:- <f:facet name="footer"> <rich:datascroller style="width:700px" id="pagination