Anda di halaman 1dari 13

JSP Tutorials

1. binary distribution

A distribution of software containing executable binaries, without source code.

2. workspace

is basically a folder where you'll store your actual source code or projects.

3.https://stackoverflow.com/questions/25431475/what-does-mean-in-jsp

@---directive attribute

Directive(ENG) Used for serving or intended to guide


https://stackoverflow.com/questions/25431475/what-does-mean-in-jsp

https://forums.asp.net/t/1139381.aspx?what+are+these+special+tags+and+

https://stackoverflow.com/questions/16285158/difference-between-jsp-expression-tags-and#_=_

https://stackoverflow.com/questions/138999/how-to-output-html-from-jsp-block

https://stackoverflow.com/questions/11481854/jsp-whats-the-difference-between-vs

https://stackoverflow.com/questions/16285158/difference-between-jsp-expression-tags-and

https://stackoverflow.com/questions/3333138/what-is-the-difference-between-and-in-jsp

http://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?searchOption=questi
on&keyword=228
https://stackoverflow.com/questions/5223257/what-is-the-difference-between-a-variable-using-
declaration-and-a-variable-is-declared-using-scriptlet

https://appus.wordpress.com/2008/05/29/diffrence-between-scriptlet-and-declaration/

4. response object

http://ecomputernotes.com/servlet/ex/httpservletresponse-and-it-s-methods

https://coderanch.com/t/503336/java/converting-servlet-response-object-http imp super imp

https://stackoverflow.com/questions/21295765/where-exactly-does-a-jsp-runs-on-the-client-side-
or-server-side

5. section Object

So, basically browser actually has a unique session associated with it in the server's memory.

So each browser or user has a unique section

Eg chrome—soham

Firefox-----ramesh

the basic idea here is that each browser has a unique session object

on the Tomcat server in memory and you can keep track of each user's individual actions,

the session object is kept in memory, so it's not stored on a database

or it's not stored on the file system, it's only in your server's memory

like in the Tomcat server memory

so the name is basically just a label


and then the value is any object
that you want to place in the session

and each user has their own session ID, so the Tomcat server will actually assign

a session ID to the user and Tomcat has its own algorithm for assigning
5. getId()-------and this is useful if you wanted to maybe log some information in your
server logs, or maybe log something in the database.

SendRedirect()----

Below link vvimp

https://stackoverflow.com/questions/20371220/what-is-the-difference-between-response-
sendredirect-and-request-getrequestdis

https://javarevisited.blogspot.com/2011/09/sendredirect-forward-jsp-servlet.html

https://stackoverflow.com/questions/7220241/whats-the-difference-between-
requestdispatcher-forward-and-httpservletrespons

I always believed sendRedirect never loses data....hmmm...?

It doesn't... You are asking a completely different application to remember some


other application's state...

https://www.geeksengine.com/article/java-redirect-lost-session.html

vvimp

https://stackoverflow.com/questions/13461838/preserving-session-in-java-with-
sendredirect vimp

https://stackoverflow.com/questions/29913900/response-sendredirect-processing

https://www.geeksengine.com/article/java-redirect-lost-session.html imp

https://stackoverflow.com/questions/2138245/session-is-lost-and-created-as-new-in-
every-servlet-request vvimp

https://stackoverflow.com/questions/8029871/servlets-sendredirect-kills-my-session-
attributes imp
6. Cookie

1.https://stackoverflow.com/questions/1969232/allowed-characters-in-cookies/1969339
imp

2.https://knowledgebase.progress.com/articles/Article/000034412 imp

3.https://dzone.com/articles/url-encoding-and-decoding-using-java imp

jsp custom tags

That's where you can write your own, custom code and implement that code and use it
as a tag. You want to make use of custom tags to implement some of your custom
functionality.

JSP standard tag libraries.

So the folks at Oracle, they've created a common set of tags that you can make use of in
your JSP environment.

Difference between jsp api jar and jsp implementation jar

https://stackoverflow.com/questions/25256768/understanding-who-provides-servlet-api-
jar-is-it-web-container-or-part-of-java vimp

https://stackoverflow.com/questions/31471468/do-i-need-jsf-api-or-jsf-impl-or-both-to-
start-using-jsf-why-are-they-not-merge imp

https://stackoverflow.com/questions/25256768/understanding-who-provides-servlet-api-
jar-is-it-web-container-or-part-of-java imp

https://stackoverflow.com/questions/39953734/what-are-jstl-mandatory-jars good info

https://stackoverflow.com/questions/35589880/which-servlet-api-jar-to-use

https://stackoverflow.com/questions/34349047/difference-between-javax-servlet-api-jar-
vs-servlet-api-jar not imp time permit yes
JSTL standard tag

core tags

There's some core tags for handling variables and looping and conditionals.

message tags

There's also message tags for handling internationalization and formatting.

function tags

There's function tags for doing string manipulation, getting the sizes of a collection.

XML tags

There's also a group of tags for XML for parsing and setting XML data.

SQL tags

And finally there's a set of tags called SQL, for accessing a database. Because the SQL
tags in general are considered bad practice. So in the industry, they say that those SQL
tags are good for prototyping, but not for real-world production applications.

WEB-INF lib directory.

This is a special directory that's a class path for your web application.

taglib uri,

So it's simply just a unique name or a unique identifier for this tag library. So the prefix
c is simply short for core. So we're gonna make use of the core tag library here.

https://stackoverflow.com/questions/27279217/what-is-a-taglib ok
https://stackoverflow.com/questions/38893729/what-is-the-difference-between-uri-and-
tagdir-in-jsp-taglib more ok

https://www.udemy.com/jsp-tutorial/learn/lecture/7227900#questions/4011926 suberb
explanation

The URI is used to locate a description of the tag library

https://stackoverflow.com/questions/17098201/can-a-tag-library-be-referred-by-more-
than-one-uri

http://www.informit.com/articles/article.aspx?p=23338&seqNum=4 imp

http://www.learncertification.com/study-material/tag-library-descriptors-in-jsp

https://www.oreilly.com/library/view/java-server-pages/156592746X/ch16s07.html

so tag library descriptor is used to guide the container to use appropriate supporting
classes from jar file. Its like mapping between tags in jsp page and its implementing
classes its like name plate in housing society (TLD)

uri is location to that housing society name plate (TLD)

https://www.careerride.com/JSP-what-is-Tag-library-descriptor-(TLD).aspx imp

https://docs.oracle.com/javaee/5/tutorial/doc/bnamu.html imp

URI--- helps to identify a resourse

https://webmasters.stackexchange.com/questions/19101/what-is-the-difference-between-
a-uri-and-a-url

https://searchmicroservices.techtarget.com/definition/URI-Uniform-Resource-Identifier

The URI itself only provides identification

A Uniform Resource Identifier (URI) provides a simple and extensible means for
identifying a resource

A uniform resource identifier (URI) is a strings of characters used to identify names


or resources on the Internet. The URI describes the mechanism(eg class path ) used
to access resources, the computers on which resources are housed and the names
of the resources on each computer.
https://stackoverflow.com/questions/176264/what-is-the-difference-between-a-uri-a-url-
and-a-urn

taglib----URI-----TLD

https://stackoverflow.com/questions/9123493/how-to-let-multi-jsp-tag-libs-use-the-
same-prefix best answer superb suberb

https://stackoverflow.com/questions/1806201/with-jsp-does-the-taglib-uri-mean-that-
my-site-is-reliant-on-the-uri-resolving imp

https://stackoverflow.com/questions/1683109/in-jsp-is-it-necessary-to-redeclare-tag-
libraries-in-included-files just refer

https://stackoverflow.com/questions/2173013/is-the-c-prefix-required-in-jstl-cforeach

https://www.studytonight.com/jsp/jsp-taglib-directive.php

https://stackoverflow.com/questions/27279217/what-is-a-taglib/27279372

just refer below link it has all your answers

http://java.scwcd.jobs4times.com/JSP-Custom-Tags-Library.html

plz look at all jsp core tags

esp param,url,remove

https://docs.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/c/tld-summary.html
PageContext

https://www.quora.com/What-is-the-difference-between-pagecontext-setAttribute-and-
request-setAttribute-in-jsp

basically saying kisko kya available hoga yeh mai

sesssion

application

request

page

se control karunga

https://beginnersbook.com/2013/11/jsp-implicit-object-pagecontext-with-examples/

pageContext---so are linking(con--text) our attribute to page scope if scope not


specified

So whenever you make use of the JSTL tags, they have to be part of an attribute

of one of the scopes either page request, session or application.

FAQ: Reading Cookies with JSTL


Lec 47 not done

JSTL Internationalization. what is internationalization?

Well, it's basically the process of designing an application

where you can adapt it to different languages without having to make changes to your source code,
format-----form(shape)+ at(addittion)

setBundle,

we tell JSP page which resource bundle to use.

Basename

so that means the base name of the file,

and then JSP will append the appropriate locale and load the appropriate properties files that you
can use in this page,

fmt

https://docs.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/fmt/tld-summary.html

The <fmt:message> tag is used for displaying an internationalized message. It maps the
key of localized message to return the value using a resource bundle specified in the
bundle attribute.

The <fmt:message>is used to display the localized messages by replacing the key specified,
with the actual message loaded from the resource bundle. This tag works in conjunction
with <fmt:bundle> tag which is used to load the resource bundle.

doGet and doPost

As from their names, doget handle HTTP get methods, while doPost handle HTTP post methods.
HTTP get methods contains parameters in their URLs, so they can be bookmarked, and get methods
are idempotent, means that you expect the same impact on the server every time you call it, get
methods are always used for data retrieval from the server. on the other side, HTTP post Methods
doesn’t contain parameters in the URL, the contain it in the Request body instead, they cannot be
bookmarked, they are non idempotent, and they are always used for data creation and update.
https://stackoverflow.com/questions/4143490/is-it-mandatory-to-have-a-doget-or-dopost-method

https://stackoverflow.com/questions/21973543/how-doget-or-dopost-method-invokes-service-
method-internally

https://stackoverflow.com/questions/2349633/doget%20and%20dopost%20in%20servlets

https://stackoverflow.com/questions/2349633/doget-and-dopost-in-servlets

https://stackoverflow.com/questions/21973543/how-doget-or-dopost-method-invokes-service-
method-internally imp

https://stackoverflow.com/questions/11625998/overriding-protected-methods

https://www.java-tips.org/java-se-tips-100019/24-java-lang/795-what-is-a-protected-
method.html

https://stackoverflow.com/questions/4811678/defining-an-abstract-class-without-any-
abstract-methods

https://coderanch.com/t/581642/java/Overriding-doGet-doPost-Methods-servlet

http://www.geekinterview.com/question_details/25048

http://www.jguru.com/faq/view.jsp?EID=47730 most imp cant ignore

https://coderanch.com/t/361568/java/reason-overriding-doGet-doPost-method imp

https://stackoverflow.com/questions/6822006/should-i-override-service-or-dopost imp

https://www.quora.com/What-is-the-use-of-abstract-class-with-zero-abstract-methods-
in-java imp

https://stackoverflow.com/questions/18909206/why-httpservlet-is-an-abstract-class-
any-functional-reason
why- httpservlet class is declared as abstract

https://stackoverflow.com/questions/6742533/why-httpservlet-class-is-declared-as-
abstract vimp superb answer

https://stackoverflow.com/questions/18909206/why-httpservlet-is-an-abstract-class-
any-functional-reason

https://stackoverflow.com/questions/29210190/abstract-class-and-template-method-
pattern-and-httpservlet imp

https://stackoverflow.com/questions/21941207/why-the-httpservlet-class-is-an-abstract
imp

https://stackoverflow.com/questions/21973543/how-doget-or-dopost-method-invokes-
service-method-internally

http://www.anyforum.in/question/java/servlet/Why-HttpServlet-class-declared-as-
abstract/564

printWriter

https://stackoverflow.com/questions/5765978/why-need-printwriter

Anda mungkin juga menyukai