post and get methods

18

Upload: baabtracom-first-coding-school-in-india

Post on 22-May-2015

100 views

Category:

Education


0 download

DESCRIPTION

Post and get methods

TRANSCRIPT

Page 1: Post and get methods
Page 2: Post and get methods

Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd

Page 3: Post and get methods

Week Target Achieved

1 40 23

2 40 27

3 40 28

Typing Speed

Page 4: Post and get methods

Jobs AppliedWeek Company Designation Applied Date Current Status

1 Intel info group System Engineer 16-9-2013 Short listed

2 Alcatel-lucent Software Engineer 10-9-2013 Waiting

3

Page 5: Post and get methods

POST and GET methods

Muhammed Noufal V [email protected]

mwww.facebook.com/vtnoufalvttwitter.com/noufalurnappyin.linkedin.com/pub/

muhammed-noufal9744003056

Page 6: Post and get methods

Request-Response Cycle

• When enter an address (URL) into the address bar of a web browser or click on a link, we generate a request for a file

• The request is routed to a Web server, which sends back a response, usually an HTML page

URLWeb

Browser

request

responseHTML, images, files

WebServer

Page 7: Post and get methods

Get Method

• Send parameters in the URL http://localhost:8081/fstpro/sec.jsp?name=sonia

• sec.jsp

<%session.setAttribute("name",request.getParameter("name"));

session.setAttribute("age",request.getParameter("age"));session.setAttribute("sex",request.getParameter("sex"));%>

• The amount of information you can send back using a GET is restricted as URLs can only be 1024 characters.

Page 8: Post and get methods
Page 9: Post and get methods

HTML Forms

• Send parameters via forms <FORM ACTION="printname.jsp" METHOD="get"> <INPUT TYPE="text" NAME="firstname" SIZE=40> <INPUT TYPE="submit" value="Print Name"> </FORM>

• Access these with the request object

<% String name = request.getParameter("firstname"); . . . %>

Page 10: Post and get methods

Post Method

• Post attaches parameter values to request

• A POST on the other hand will (typically) send the information through a socket back to the webserver and it won't show up in the URL bar.

• You can send much more information to the server this way - and it's not restricted to textual data either.

Page 11: Post and get methods
Page 12: Post and get methods
Page 13: Post and get methods
Page 14: Post and get methods
Page 15: Post and get methods
Page 16: Post and get methods
Page 17: Post and get methods

Get & Post

• Get puts parameters and values in the URL page.jsp?param1=value1&param2=value2&...– Send with a link or in a form with method="get"

• Post attaches parameters to request– Send in a form with method="post“

GET POST• Parameters encoded in URL attached to

request• data limit URL length no limit• Bookmarks yes no

Page 18: Post and get methods

Contact Us

Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

Start up VillageEranakulam,Kerala, India.

Email: [email protected]