Thursday 29 November 2018

The Unplanned Trip To Shirdi | No Hotel And Travel Booking | #Fun









One day, my colleagues (friends) asked me to come with them to visit Shirdi and refresh the mind from the work load. These guys are my first 20's friends, so I said "YES, Sure!" immediately. On the night of journey, I joined the rest of the crew, we were total 9 guys and getting a new experience to travel without booking any hotels and most traveling sources. I think it is an important experience to learn how to manage money and travel safely. Panicking is not an option. The thing that I learnt is "Help can be given to those who just simply ask for it". So I would like to thank the crew and the people that we meet who gave us helping hands.

Sunday 11 November 2018

JSP Tutorial | Creating MVC Web Application In Java | Servlet | Netbeans...




















Hello
guys, this is unpossible pog and in this video, I shall tell you how
to create MVC framework using jsp and servlet
First
I will show you the live example, blue dart’s old website was
developed using JSP MVC concept. They just forgot to give proper
names to servlet but whatever.
The
main reason to hide web page is to make it safe from hackers by not
leaving file names like .html . Jsp etc
So
lets create a web application in netbeans.
Give
any random name. Click next twice. And click on finish.
Now
lets run the web app first.
Ok,
so lets add my youtube channel name there.
Now
right click on default packages, and add servlet. Give the random
name, click on next and make sure to click on “Add information to
deployment descriptor” which will create web.xml file
automatically.
The
servlet file is open.
Then
go to web pages, then web-inf, and open web.xml.
You
can see the servlet’s name. Now lets create a link go from one
page to another.
Create
jsp page, and give it a any name, in href, give the name of jsp file
that we have created along with it’s extension.






Now
lets refresh project, and when you click you will go to second page
but the problem is that in URL you are reavealing the file name.
So,
go to web.xml and in url pattern, give the any name which will hide
the file name. Copy that name and replace it in href.
Inside
try, You can see that there is un necessory content, so just comment
that, and we shall create reuest dispatcher variable, and add
“second_page.jsp” file in getRequestDispatcher’s first
argument.
Now
we are forwarding, so lets re-run project and now when you click on
link, we went to send page without revealing the second_page.jsp.
But
what happen you u want to send value thrugh url, so for example, go
to youtube and search something, you can see that result is the
servlet, and we send value as thanos in search_query variable.
Go
to index page, and create variable as “search” and give the
value.
Oops,
there should be question mark.
Now
go to servlet, create string variable, and in getParameter, give the
variable name, in our case its “search”.
Now
we set attribute, give any random name in first argument, and in
second argument, add string variable “A”.
Now
go to second_page.jsp file and use jsp syntax to print value of
search using request.getAttribute, paste the name of variable from
servlet to second page, now lets run the project.
Thnak
you for watching, Dont forget to like share and subscribe, and in
next part, I will create working with model that is database, so stay
tuned.