Web page in Java

So I am brand new to Java but I have developed in C++. I dont have alot of experience building websites or webpages. I am starting an individual graduate project for my degree. It involves building a web page that will be hosted by my teacher. My question to you is, Can i use java to do this? Basically I would use java instead of html, if it is possible. If it is, how do I get started. If not, what do you recommend? I figured since I know C++ already, its time for me to learn Java. What better way to do it than with a project. All advice is appreciated. Thank You.

Basically I would use java instead of htmlBrowsers only understand html. You need to know html to create web pages. What java can help you do is respond to information that users enter into forms on html pages. You can also use java to create an html page to send back to the browser as a response, which the browser will display to the user.
An html page (HelloWorld.html) is typically a static web page to display a document with no dynamic
abilty such as submitting a textfield (that a user entered information into such as a password) to the
server (although you can probably force it to be). Html pages frequently contain forms which users fill out and then submit. Html pages that contain forms were around long before java servlets + jsp's were invented. If you want the user to enter some info, then you have to send an html page with a form on it to the browser. How you create the html page is up to you. It can be a static file on the server which your java code just relays to the browser, or you can use servlets + jsp to retrieve some data from a database and then create an html page on the fly that contains the data, and then send that "dynamically created" html page back to the browser. But no matter how the page is created, the browser receives an html page, which the browser then displays. And the html page will look exatcly the same to the browser no matter how the page was created.
I am starting an individual graduate project for my degree. It involves building a web page that
will be hosted by my teacher. My question to you is, Can i use java to do this?Yes, but you are a thousand miles away from being able to do that in java. First, you have to learn the java language, just like you learned C++. You could read a short beginners book on java to get a cursory grasp of the basics. But after you learn some basic java, then you have to learn about a software application written in java called "servlets + jsp". The application "servlets + jsp" gives you the means to do web programming. You will speak to that application using the java programming language. But in order to learn how the application "servlets + jsp" works, you will have to read another book, and servlets + jsp is not an easy application to figure out. You might need a couple of months of studying to achieve your goal, which is a big time comittment for a student, so that is pretty unrealistic. You might be able to read a bunch of tutorials and throw something together, but you won't have any idea what's going on, and you'll probably need a lot of help.
If you want to get your project done in a reasonable amount of time, you should probably learn php. A beginning php book will teach you the basics of html and forms, as well as teach you how to use databases to store information that users submit, e.g. login names and passwords. In my experience, some php books get you up to speed very quickly in 3 or 4 chapters and teach you to do some neat stuff immediately.
Another thing you need to consider is: what type of software does your "host" have? If your host doesn't have Tomcat installed, then you can't use servlets + jsp. If you decide to use php as your "server side web programming language", then your host needs to have php installed.

Similar Messages

  • How to embed 3D models in web page using JAVA?

    Hello
    I'm doing a project at University to create a virtual tour of a village. I am creating the buildings in MAYA using polygon planes and cubes and then exporting to VRML.
    I plan to embed each individual model into a separate web page. Then when the user clicks on a location in a 2D map they will be taken to the web page containing that building.
    However, I can't work out how to embed these 3D models into web pages using JAVA. Can anyone help me with this, please?
    Also, I've been told to use JAVA 3D to interact with the project but am unclear as to how JAVA 3D would be used in this project - aqny ideas/suggestions welcome!
    M.

    If you use Java-plugin, you can embed Java3D in a web page.
    Here is the URL(http://www.geovista.psu.edu/products/demos/LorenzAttractor3D/index.html) which used Java3D.
    I hope this helps.
    Masa

  • Web pages in java

    i want to make a web page in java.what r the ways to do this?

    u need one one web server like tomcat, and one servlet.jar and u should about to code servlets, enough u can develop a website

  • OMG! These web pages are java classes! :) A simple question!

    I imported a web page fragment as "header". Now I'm trying to display the header before "page1".
    I tried putting this into the page1.java, but no luck.
    public HtmlForm getHeader() {
    doug2005.header hd = new doug2205.header();
    return hd.getForm1();
    This has to be simple to do. How should I do the method?
    Thanks!

    Thanks! That worked very well. I think I'm getting the idea here. I'm working with something called "JSP" pages which is there own language like "ASP" pages.
    You don't happen to know the current links to these directives and such. My searches tend to bring up outdated material.
    Thanks much!

  • Get content of web page in java. Result - bad chars.

    My common task is - get content of page in java. And parse data on this page.
    When i am opening page in browser - i have a good look of all data. But when i am using java code for getting page content i have a bad content with bad chars.
    How to do it right?
    Thanx in advance!
    public static void main(String[] args) {
                 String url_get_page = "http://www.pai.pt/search.ds?activeSort=name+-maindocflag|asc&distSort=false&encodedRefinement=namechar1..%3d..^A%24..%26..A&what=Advogados&startingPageNumber=1&stageName=What+search&originalOffset=1&expandWWWSearch=false&myplaces=false&distance=50&searchType=www&phoneNumberSearch=false&advancedSearch=true&alphaRefineable=AN4683|BN317|CN2373|DN696|EN704|FN1549|GN456|HN539|IN670|JN3704|KN8|LN1433|MN4143|NN606|ON318|PN1727|QN9|RN1383|SN1522|TN484|UN14|VN677|WN16|XN8|YN4|ZN23|[0-9]N0&excludeZone=false&restoSearch=false&firstMaxRank=43522&previousPath=search";
                 StringBuffer result = new StringBuffer();
                 URL url;
              try {
                      url = new URL(url_get_page);               
                         HttpURLConnection connection = null;
                             connection = (HttpURLConnection) url.openConnection();                       
                     connection.setRequestMethod("GET");
                     connection.setDoOutput(true);
                        connection.setReadTimeout(10000);           
                        connection.setRequestProperty("Host", "www.pai.pt");
                        connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6");
                    connection.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
                    connection.setRequestProperty("Accept-Language", "ru,en-us;q=0.7,en;q=0.3");
                    connection.setRequestProperty("Accept-Encoding", "gzip,deflate");
                    connection.setRequestProperty("Accept-Charset", "windows-1251,utf-8;q=0.7,*;q=0.7");
                    connection.setRequestProperty("Keep-Alive", "115");
                    connection.setRequestProperty("Connection", "keep-alive");
                    connection.setRequestProperty("Referer", "http://www.pai.pt/search.ds");
                     connection.setRequestProperty("Cookie", "MfPers=12678646695048a98819027298bf50127329f8c315e8f; vuid=8a98819027298bf50127329f8c315e8f; ptkn=40EAFA18-5758-F374-F570-A0480F306222; WT_FPC=id=174.142.104.57-1456441520.30063880:lv=1267888167073:ss=1267888167073; __utma=76091412.2059393411.1267864686.1267878351.1267891770.4; __utmz=76091412.1267864686.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); BFHost=wd-web04.osl.basefarm.net; JSESSIONID=20C8FD4414F50F3AE361C487D0E3C719; MfTrack=12678917654148a98819027298bf50127329f8c315e8f; BIGipServerwd-web-pt=285284362.20480.0000; __utmb=76091412.1.10.1267891770; __utmc=76091412");           
                     connection.connect();
                     BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream(),"UTF8"));
                     String line;
                     while ((line = rd.readLine()) != null) {
                         result.append(line).append("\n");
                     connection.disconnect();
                   } catch (MalformedURLException e) {
                        e.printStackTrace();
                   } catch (IOException e) {
                        e.printStackTrace();
                System.out.println(result.toString());            
         }

    Now the code is
    public static void main(String[] args) {
                 String url_get_page = "http://www.pai.pt/search.ds?activeSort=name+-maindocflag|asc&distSort=false&encodedRefinement=namechar1..%3d..^A%24..%26..A&what=Advogados&startingPageNumber=1&stageName=What+search&originalOffset=1&expandWWWSearch=false&myplaces=false&distance=50&searchType=www&phoneNumberSearch=false&advancedSearch=true&alphaRefineable=AN4683|BN317|CN2373|DN696|EN704|FN1549|GN456|HN539|IN670|JN3704|KN8|LN1433|MN4143|NN606|ON318|PN1727|QN9|RN1383|SN1522|TN484|UN14|VN677|WN16|XN8|YN4|ZN23|[0-9]N0&excludeZone=false&restoSearch=false&firstMaxRank=43522&previousPath=search";
                 StringBuffer result = new StringBuffer();
                 URL url;
              try {
                      url = new URL(url_get_page);               
                     HttpURLConnection connection = null;
                    connection = (HttpURLConnection) url.openConnection();                       
                     connection.setRequestMethod("GET");
                     connection.setDoOutput(true);
                    connection.setReadTimeout(10000);           
                    connection.setRequestProperty("Host", "www.pai.pt");
                    connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6");
                    connection.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
                    connection.setRequestProperty("Accept-Language", "ru,en-us;q=0.7,en;q=0.3");
                    connection.setRequestProperty("Accept-Encoding", "gzip,deflate");
                    //connection.setRequestProperty("Accept-Charset", "windows-1251,utf-8;q=0.7,*;q=0.7");
                    connection.setRequestProperty("Keep-Alive", "115");
                    connection.setRequestProperty("Connection", "keep-alive");
                    connection.setRequestProperty("Referer", "http://www.pai.pt/search.ds");
                     connection.setRequestProperty("Cookie", "MfPers=12678646695048a98819027298bf50127329f8c315e8f; vuid=8a98819027298bf50127329f8c315e8f; ptkn=40EAFA18-5758-F374-F570-A0480F306222; WT_FPC=id=174.142.104.57-1456441520.30063880:lv=1267888167073:ss=1267888167073; __utma=76091412.2059393411.1267864686.1267878351.1267891770.4; __utmz=76091412.1267864686.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); BFHost=wd-web04.osl.basefarm.net; JSESSIONID=20C8FD4414F50F3AE361C487D0E3C719; MfTrack=12678917654148a98819027298bf50127329f8c315e8f; BIGipServerwd-web-pt=285284362.20480.0000; __utmb=76091412.1.10.1267891770; __utmc=76091412");           
                     connection.connect();
                     BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream(),"UTF8"));
                     String line;
                     while ((line = rd.readLine()) != null) {
                         result.append(line).append("\n");
                     connection.disconnect();
                   } catch (MalformedURLException e) {
                        e.printStackTrace();
                   } catch (IOException e) {
                        e.printStackTrace();
                System.out.println(result.toString());            
         }I have checked in FF encoding of page is - UTF8.
    The problem still exists.

  • Loading web page in java

    Hello,
    Any ideas on how to load a web page in an applet to
    the memory (not opening a browser window)? I found
    only getImage() and getAudioClip(), but not "getDocument()".
    Thanks,
    Shay.

    use a java.net.URL object : cautio, with an unsigned applet the web page must come from the same domain name as the applet.

  • Taking regular text from a saved web page through java.

    Hello, currently I'm trying to save the source code from a regular HTML web page as a string. Which in fairness is pretty simple through the URL and InputStreamReader classes.
    But my problem is I'm not fully sure how to save the source code when the page is saved on your hard drive, as the (i think) URL class tries to look for a non-existant host.
    I think I need to use the HTMLEditor class but my knowledge of this is vague at best.
    Any ideas?
    Also I''m just trying to take out the regular text from the page (ie. what you see on the screen) and store that, is there any way specifically I should go about this? As I doubt it's going through the entire string and looking for specific tags to remove.
    Thanks in advance

    Yes, I need to calm down. That worked me up a bit, I'l admit.
    Oh, I'm with you 100%. Ipad is a nice 'accessory' to a PC or Mac. No replacement, by far.
    I didn't share this, but I think it was in a frame or apart of a link. The ipad wanted to follow the link. At the other page was the same info. Still, I could not select it.
    The ipad2 has dual processors. Do you think that could make a difference?
    I was advised once to re-boot my cell-phone often. To clear it's memory. Does the Ipad need this as well?
    I can select all day long while in this text edit box. But if I wanted to quote you by copy/paste, I cannot. Interesting. And it is right above and on the same page I am working on.
    Definitely an area for improvement.

  • Some web pages need Java Platform to open-Can I download Java for I Phone?

    Cant opend some pages that needs Java to start.
    Where can I download Java Platform for I Phone 3D ?
    Thanks
    J.B

    Ok, It is my first time here on forum, so I posted by mistake the question
    several times SORRY !!!!!!! I tried to take it away but no.
    I have no intentions to "get extra responses".
    Banned ???? You must be joking !!!!
    I have bought a new Iphone 3D and cant open several pages with Java
    and I bring it up on ths forum, What is your problem ??

  • Creating web pages in java

    hi
    in the system im developing i need to create html pages as output, im wondering how you would create html links as output as the html code here would create problems with the java println function which uses "" to contain strings.

    if you need " in a String thrn you need to 'escape' it (with a '\') just before, so...
    String aStringWithQuotes = "Hi there \"Me :-)\"";
    would, if you use System.out.println(aStringWithQuotes);
    give you..
    Hi there "Me :-)"

  • How to open a web page in java in Solaris system

    i can do this in windows:
    String location = "www.sun.com";
    Runtime.getRuntime().exec("explorer " + location);how could i get it in solaris?
    Thanks

    Isn't this question completely outside the scope of this forum ?
    ... this is a forum for Solaris Zones, not Java or software development.
    http://forum.java.sun.com/thread.jspa?threadID=5075398
    Perhaps your query would be more appropriate in one of these other areas of discussion:
    http://forum.java.sun.com/index.jspa?tab=java

  • Reading Links from a web page to JAVA program

    I am writing Search engine code using servlets. I want to copy links from different search engines. plz help me.

    I want to copy links from different search engines.Not clear; do you want to read the file content on the internet given the url address? or ?
    Can you explain more
    Regards,
    Alan Mehio
    London, UK

  • Web page asking to enable java

    I cannot run web pages with java script such as yahoo games crossword
    == URL of affected sites ==
    http://games.yahoo.com/games

    You have a <u>'''very old'''</u> version of Java and Firefox 3.6 and higher requires Java 1.6.0.10 or above. Try updating to see if that resolves your problem. To avoid problems, it usually works out best to remove these very old versions of Java through Control Panel > Add or Remove Programs, restart your computer, then follow the instructions in the article below to do the online installation of the new Java. Remember to restart Firefox after the online installation of Java.
    <u>'''Install/Update Java'''</u>: your ver. 1.4.1_02 (~~red:very old~~); current ver. 1.6.0.20 (<u>important security update 04-15-2010</u>)
    (~~red:Firefox 3.6 and above requires Java 1.6.0.10 or higher~~; see: http://support.mozilla.com/en-US/kb/Java-related+issues#Java_does_not_work_in_Firefox_3_6 )
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Installing_or_updating_Java Installing Java]'''
    Do the update with Firefox closed.

  • RE: Can I hit a web page in my Java application ??

    I want to hit some web page through Java application, how should I do? Can I call something like HTTP://.... in my Java application??
    TIA
    Xin

    Just compile and run the testVisit program as follows:
    java testVisit http://www.yahoo.com
    testVisit.java
    ==========
    import java.net.*;
    import java.io.*;
    public class testVisit {
       public static void main(String[] args) {
          try {
             URL url = new URL(args[0]);
             URLConnection connection = url.openConnection();
             connection.setRequestProperty("Referer", args[0]);
             connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0");
             BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
             String Line;
             while ((Line = in.readLine()) != null) System.out.println(Line);
             in.close();
          } catch (Throwable e) {e.printStackTrace();}
    };o)
    V.V.

  • Probably not the right place to be asking but....Java on web pages

    Create web pages using Java     ?     
    > create web pages using Java
    > demonstrate an understanding of how Java can be used in web pages
    > create graphics on web pages using Java
    The above is an objective from Edexcel's Higher National Diploma syllabus for the unit Java Programming.
    Another part of the syllabus, referring to this, talks about Javascript. Having contacted Edexcel and pointed out that Java and Javascript are different, I was told "oops we meant Java".
    Has anybody any idea what they might be expecting because I can't get them to answer any more queries.

    Create web pages using Java     ?     
    create web pages using Java
    demonstrate an understanding of how Java can beused in web pages
    create graphics on web pages using Javahe above is an objective from Edexcel's Higher
    National Diploma syllabus for the unit Java
    Programming.
    Another part of the syllabus, referring to this,
    talks about Javascript. Having contacted Edexcel and
    pointed out that Java and Javascript are different, I
    was told "oops we meant Java".
    Has anybody any idea what they might be expecting
    because I can't get them to answer any more queries.So do they mean Java or Javascript in web pages??
    Either way, if they got it mixed up then that is course you want to stay well away from.
    Java in web page = JSP or JSF, 2 examples.
    Javascript is .... well..... Javascript!
    Ted.

  • How to open web pages from japplet??

    Hi
    Does anybody know how to open web pages from java japplet??
    Any help is apreciated!
    zick

    the getAppletContext() method of the Applet class will get you an AppletContext, with which you can call the ShowDocument(URL url) or ShowDocument(URL url, String target) method...
    check it out at http://java.sun.com/j2se/1.4/docs/api/java/applet/AppletContext.html
    have a good one :)
    Jay

Maybe you are looking for

  • What are the pro's and con's (samplers)

    -I hate to beat and dead horse, but Im about to buy some new software, and I trying to make the best choice-- What are the pro and cons of the major samplers (Im looking for a more radio-ish sound, motif/triton/phantom). i.e:mach five, sampletank 2l,

  • Acrobat 9.5 Pro not responding

    Tried to get support through chat but I have to pay! the other day it just decided to "not respond". It opens for a few seconds, which still allows me to convert docs to pdf and save, but nothing else. Can't do any updates either (I always allow the

  • Restrict shudown database for a time interval

    Hi, I an using oracle10g in AIX.. Can i restrict the shutdown operation within a time intervall....say for eg: "Shutdown immediate" should not be accepted by sqlplus, if it is issued after 10am and before 6:00Pm.... Regards, Jibu

  • Collections Installation not working

    Hello All, We are in process of implementing Advanced Collections on 11.5.10.2 and facing problems in UWQ and Collections Forms. UWQ form and Collections form raises different errors - Business Object IEXRCINT is not registered - GLOBAL.AST_ADMIN_FLA

  • SRM--XI--MDM connetivity

    Hi, I have a requirement of connecting SRM-- XI--MDM system. All the system is newly configure. We have a Tcode in SRM system(standard )  and  when ever that execute the same data need to be updated in MDM system. When I went through the TCODE progra