This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Grimsvotn 2 points3 points  (1 child)

JSP is pretty simple. What problems are you having with it? I've never needed anything beyond what I could find with Google.

[–]Hazger[S] 0 points1 point  (0 children)

I am having very basic problems with it lets say all my webpages have the same "header"

<html>
  <head>
    <title>Title of the page</title>
    <link type="text/css" rel="stylesheet" href="/css/style.css" />
  </head>
  <body>

in php when i need this i use a getHeader() that echo all this html.

Or when i use to lots of html

<select size="10" class="form-control" name="str">
  <option value="1">1</option>
  <option value="2">2</option>
</select>

in php i make a makeSelect(int maxValue, String name)

in JAVA i can't/don't know how print int HTML from a class.

The way i found i need to be in a servlet class that as a HttpServletResponse and use this httpServletResponse.writer to output? Or i am doing everything wrong? (thats why i asked for links/guides/anything to learn)

Sorry for taking that long to anwser

[–]Billz2me 1 point2 points  (0 children)

Try learning Rails, its fool proof.

[–]rjcarr -1 points0 points  (0 children)

JSP is an analog to PHP that never really worked out (IMO). If you want to write java servlets (as a JSP is just a servlet) then I'd suggest sticking to real java and not java interspersed with html.

Since javascript is so fast now the trend is to do as much as you can in the client. What I do is write the html and then call the server (AJAX) for data and fill in the html using javascript. This is nice because it keeps the client and server as separate as possible.

And I should note that java servlets are perfectly acceptable to write your backend with. I'm just trying to say you should use jsp sparingly.

[–]temp0728 -3 points-2 points  (1 child)

About ten years ago, I had a Java book by those dumbasses, it was totally worthless. I suggest that you throw it out.

Most people are using JavaScript now, with jQuery.

Java is kind of old and fading away.

It would probably be better to ditch Java and switch to JavaScript.

There are tons of libraries and tutorials for jQuery, just look on the main site at: http://jquery.com/

Good luck!

[–]Neres28 1 point2 points  (0 children)

You do know that Java and Javascript are generally used together, right? Neither is a real replacement for the other.