Jump to content

greekos_kentos

Member
  • Posts

    42
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Posts posted by greekos_kentos

  1. I'm tring to create a servlet that will calculate numbers input by the user but i'm a little stuck.

    This is what i have done so far

    <HTML><HEAD><TITLE>Call servlet to Calculate numbers</TITLE></HEAD>

    <BODY><H1>Calculator</H1>

    <P><FORM ACTION="/servlet/Add"
       METHOD=GET>

    <P>First number : <INPUT TYPE=TEXT NAME=number1>

    <P>Second number : <INPUT TYPE=TEXT NAME=number2>

    <P>
    <SELECT name=Action>
    <OPTION value="" selected>- Select -</OPTION>
    <OPTION value="+">Add</OPTION>
    <OPTION value="-">Subtract</OPTION>
    <OPTION value="/">Divide</OPTION>
    <OPTION value="*">Times</OPTION>

    </SELECT>

    <P><INPUT TYPE=SUBMIT VALUE="Add the numbers">
    </FORM>


    </BODY>
    </HTML>

    // AdditionServlet.java

    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;

    public class Add extends HttpServlet {

     public void doGet(HttpServletRequest req, HttpServletResponse res, HttpServletRequest req2)
       throws ServletException, IOException {
       res.setContentType("text/html");
       ServletOutputStream out = res.getOutputStream();

       out.println("<HTML><BODY>");
       out.println("We are pleased to inform you that the result " +
     "of your calculation is now ready:");
       
       String[] number1params = req.getParameterValues("number1");
       int number1 = Integer.parseInt(number1params[0]);
       
       String[] number2params = req.getParameterValues("number2");
       int number2 = Integer.parseInt(number2params[0]);
       
        String[] actionparams = req.getParameterValues("action");
       int action = Integer.parseInt(actionparams[0]);
       
        if (action == '+') {
       int sum = number1 + number2;
       out.println("<P>You kindly sent us the numbers " + number1 +
     " and " + number2);
       out.println("<P>The sum of the numbers is " + sum);
       out.println("</BODY></HTML>");
    } else {
       out.println("<P> Wrong value");
       out.println("</BODY></HTML>");
    }
       
       
       
     }

    I'm getting the error "HTTP method GET is not supported by this URL"

    Any ideas what i have done wrong??

  2. I'm using the following inf to accosicate .mp3 .mp4 files with winamp but if doesn't seem to be working can anyone help me out :no:

    Thanks

    [Version]
    Signature=$CHICAGO$

    [DefaultInstall]
    AddReg=Reg.Settings

    [Reg.Settings]
    HKCR,.mp3
    HKCR,.mp4
    HKCR,mp3file,,,"MPEG Layer 3 Audio"
    HKCR,mp3file\DefaultIcon,,,"%MP3ICON%"
    HKCR,mp3file\shell,,,"open"
    HKCR,mp3file\shell\open
    HKCR,mp3file\shell\open\command,,,"""%MPCPATH%"" ""%L"""
    HKCR,mp4file,,,"MPEG4 Video"
    HKCR,mp4file\DefaultIcon,,,"%MP3ICON%"
    HKCR,mp4file\shell,,,"open"
    HKCR,mp4file\shell\open
    HKCR,mp4file\shell\open\command,,,"""%MPCPATH%"" ""%L"""
    HKCU,%SMWCEF%\.mp3,Progid,,"mp3file"
    HKCU,%SMWCEF%\.mp4,Progid,,"mp4file"

    [Strings]
    SMWCEF="Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts"

    ;Editable Strings
    MPCPATH="%16422%\Winamp\winamp.exe"
    MP3ICON="%16422%\Winamp\icons\mp3.ico"

  3. I fail to see how a search function that when you search for 2 pictular terms. The top 5 results do not contain a single word of the two words searched for is any good? I've tryied to use the search function here many many times and can hardly ever find what I am looking for. All other boards i use i no trouble. :(

  4. It has to be said that the search function on this forum is VERY! poor. example: I searched for 3 key words when I opened most the the threads they didn't contain a single word of what I searched for. :no::}

    It makes using the forums a huge pain and most of the time I find my self going elsewhere.

  5. I'd like to create a menu like the one on the left of this page http://www.omegadrivers.net/

    I've copyed the script and it works fine but what i can't seem to do is change the links in the menu from plain text into images. I've tried this

    addExItem("<IMG SRC="images/menu/about_off.gif">", "http://www.sunburysonics.co.uk/menu.html", "center_frame");

    But when i add that the menu doesn't even appear. Can you guys help me out please?

    Thanks

  6. I've download the latest Network driver for my nwk card, but it comes with drivers for linux, 9x etc etc drivers as well. What i want to do is remove all of the driver files apart from the ones that winxp pro needs. Then use nlite to intergrate them. How do i go about doing this??? how do i know what files it needs and what ones it doesn't?? and do i remove lines from the inf as well?

    Thanks

×
×
  • Create New...