Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 32

Thread: Jsp

  1. #1
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0

    Question Jsp

    as'kum wbt..tak aci ler..knp takde sapa2 yg nk discuss pasal JSP+servlet ..? JSP

  2. #2
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    Eeehh.... probably this section of the forum is about ColdFusion and ASP, and nobody start a topic on JSP before

    What do you want to talk about JSP?? Any problem?

  3. #3
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0
    sori..tapi saya nk tanya..camne kita nk setkan default page kita .jsp ? sbb selalunya default page ialah .html[B] . cthnya lps kita taip http://localhost:8080. lps tu...camne konsep mapping ?

    ada sesapa yg faham ttg servlet yg dihasilkan oleh file .jsp yg dah kita create (i.i lps kita compile?).

    thanks n wassalam.

  4. #4
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227

    Lightbulb

    Oh, you can always change the default page from the web server. And this of course depends on which web server you use - Apache, IIS, JRun, PWS, Java webserver, ...

    For instance, you can follow the following to change the default page in JRun:

    1. Login Admin
    2. Click on Web Applications
    3. Click on the application that you wish to change
    4. Click on File Settings
    5. Click on Default Documents
    6. Edit to whatever your default page should be....

    Which app server you are using?

    p/s: JRun is a Java application server (supporting JSP, Servlet, ...) with web server built in. This product is from Macromedia+Allaire.

  5. #5
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    Originally posted by sinwauzaiya
    ada sesapa yg faham ttg servlet yg dihasilkan oleh file .jsp yg dah kita create (i.i lps kita compile?).
    Hmmm, what do you want to know? I may be able to help although I don't know much about jsp + servlet either

  6. #6
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0
    salam..
    saya guna Tomcat 4.0
    cara yg saya guna skrg..

    1. copy index.html yg asal
    2. index.html yg lama -saya edit..then..itu la my default page

    tp..cara tu mcm weird je..maybe ada setting kat server.xml atau web.xml..?

    bos saya guna JRun tp saya try Tomcat..

    thanks in advance.

  7. #7
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    You can edit web.xml manually to change the filename for the default page.

    Your web.xml should have these couple of lines...

    <web-app>
    <welcome-file-list><welcome-file>index.jsp</welcome-file><welcome-file>index.htm</welcome-file></welcome-file-list> ...

    Simply edit the content of <welcome-file> to whatever filename you wish to become the default page's filename. In my example above the default pages are index.jsp, followed by index.htm...

  8. #8
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0
    salam..

    saya dah try tukar kat web.xml

    index.jsp
    index.html
    index.htm

    tp bila saya taip localhost tu...index.html gak yg jadik default page..camne nih..?

    n then saya pun rename la index.html kat explorer tu ke indexi.html..baru la index.jsp tu jadik default page ..pls help..
    thanks..

    oo..lagi satu..saya nk tukar port ke 80..dari 8080 but at the same time i ada Apache..i dah stop kan Apache tu..n saya dah tukar kat server.xml ke port 80...tp bila saya taip localhost..default page tak naik pun..? kenapa 'ek?

    thanks.

  9. #9
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    indexi.html
    ?? Are you sure??

    One thing to note is that you do not need to type any file name after your domain/host's name. For example

    http://localhost/bla/bla/

    I am not sure about Apache though... I myself a beginner at Jsp+servlet (using JRun)

  10. #10
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0
    well..port Apache :80 and Tomcat:8080 so..default port adalah :80..means kalau i nk tengok Tomcat tu run ke tak..terpaksalah i taip camni http://localhost:8080 where kalau Apache..terus je taip http://localhost
    anyway..not to worry sgt la pasal ni..

    btw..rather better we guna nama file ni for future reference test.jsp ..ok?

    so..apa yg u faham pasal JSP dgn servlet ni? adakah +servlet ni ..servlet JAVA yg real atau servlet on the fly(masa compile file test.jsp)? bcoz i was told..masa kita compile file test.jsp tu, it will generate servlet but on the fly-means temporary laa...so..betul ke cam tu wahai kpyew?


    mapping tu camne? says..i nk buat folder baru..something to do w/ server.xml? kat sini :

    <Context path="/examples" docBase="examples" debug="0"
    reloadable="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_examples_log." suffix=".txt"
    timestamp="true"/>


    n so on...

    pls explain..
    thanks.

  11. #11
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    The servlets compiled from jsp files are real Java servlets. The app server will automatically compile your jsp files into servlets, and this is normally done the first time the file is requested.

    To ensure that your user doesn't get a delay when the file is requested (for the first time) when the file is compiled, you can simply request the file yourself after installing it...

    -The mapping thing, I have no idea

  12. #12
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0
    salam..

    kalau servlet yg compiled from .jsp file tu adlh the real servlet..so, y not we simply use file .java yg akan generate servlet . no need la nk bersusah payah pikir pasal .jsp lagi...camne tu? saya still confuse nih...

    ok..thanks.

  13. #13
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    JSP enables you to mix regular static HTML with dynamically generated content from servlets. You can simply write the regular HTML in the normal manner, you can even use your familiar webpage-building WYSIWYG tools to do so... this will eventually make the coding much faster...

    In JSP you can simply do this:

    Hello <%= request.getParameter("name") %>

    Where as in servlets, to output normal HTML codes, you have to do something like this:

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("Hello " + request.getParameter("name"));

    If you have lots of normal HTML codes, you will have out.println all over your servlet (at least)...

    Hope this explains...

  14. #14
    Join Date
    Aug 2001
    Location
    shah alam
    Posts
    14
    Rep Power
    0
    hemm..baru la saya satisfied..thanks ye..anyway..ada lagi nih..

    camne kita nk link kan dr default page ke file dlm folder yg luar dr C:\tomcat\webapps\root

    cth:
    C:\tomcat\webapps\root\test.html

    dlm test.html tu ada


    JSP
    SERVLET

    so..bila click kat JSP tu saya nk retrieve file camni:
    C:\tomcat\webapps\examples\try.jsp ?

    pls help.

    anyway..thanks..

  15. #15
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    227
    Confused... not very clear what you wanted to do?

Page 1 of 3 1 2 3 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31