I want to check if session exists or not in java application. So I am calling the servlet from Angular, but it is saying null pointer exception, that means even though I am logged in in the java application, when I call the servlet from Angular, it says 'null' for session variable, HtttpSession session = request.getSession(false); I am going fromjava application to Angular application, from Angular I am calling java servlet to check if session exists, if it exists, it will directly login in Angular app, otherwise login page of Angular.
A session id is generated in back-end and travel though request/response when sending request from browser . In angular making call through http api which doesn't track session, thats why getting null. Session is not used to track user in back-end api , token concept is used for authentication/authorisation in api
Development environment means where I'm developing rt ? Using Spring tool suite (STS) for writing code . STS is just like eclipse with some extra plugins related to spring /spring boot
Hii bro i am trying to send post request to java servlet . servlet runs but servlet dont recieve any parameters. But if i try to send parameters like ?user="Abc"?pass="1234" . it works...! how to fix it..
Are you making ajax call ? Are you extending your servlet class from HttpServlet ? If Extending from HttpServlet then post(..) method will be called . If making ajax call please make sure your are specifying request method as post.
@@amolgode9843 In Angular js use below code to send post request var data = (id:123,age:20. email:'abc@email.com'}; $http({ url: "create-user", method: "POST", params: data }); In Servlet use req.getParameter("id")....
@@codingboot455 http status 404 not found type : status report description the origin server did not find a current representation for the target resource or is not willing to disclose that one exists
Really, really thankyou, you saved my life!
Good work yaar...Keep continue
Kindly Upload Full Crud operation using Spring MVC with Angular Js
I want to check if session exists or not in java application. So I am calling the servlet from Angular, but it is saying null pointer exception, that means even though I am logged in in the java application, when I call the servlet from Angular, it says 'null' for session variable, HtttpSession session = request.getSession(false); I am going fromjava application to Angular application, from Angular I am calling java servlet to check if session exists, if it exists, it will directly login in Angular app, otherwise login page of Angular.
A session id is generated in back-end and travel though request/response when sending request from browser . In angular making call through http api which doesn't track session, thats why getting null. Session is not used to track user in back-end api ,
token concept is used for authentication/authorisation in api
Really Very Help Full...
Thanks Deepak
Can we use here Data-Table concept also to create the PDF,Excel and CSV file and default search option also be used
@@deepakpareek3014 yes we can use here data-table concept it provides more features filter, sorting .... Options
best
Thank you soumyadip
Very nice bhai
Thanks 😊
Hello can anyone please tell me why we use search function we could use just filter
If you want to write complex condition then you can write custom search function
Thank you
Can you provide Integration of Spring MVC with Angular JS ?
I will upload soon 'Spring rest using spring boot' and angularjs integration
Hello What is the development environment? Thanks
Using sts IDE, MySQL Db ,java ,servlet
@@codingboot455 I did not ask about languages. i ask related to the development environment. Probably It is webstorm or visual studio
Development environment means where I'm developing rt ? Using Spring tool suite (STS) for writing code . STS is just like eclipse with some extra plugins related to spring /spring boot
@@codingboot455 yes where you develop the code. Thanks I downloaded it here spring.io/tools#suite-three
Hii bro i am trying to send post request to java servlet . servlet runs but servlet dont recieve any parameters. But if i try to send parameters like ?user="Abc"?pass="1234" . it works...! how to fix it..
Are you making ajax call ? Are you extending your servlet class from HttpServlet ?
If Extending from HttpServlet then post(..) method will be called .
If making ajax call please make sure your are specifying request method as post.
@@codingboot455
Bro i am using angular. Bro plzz tell how to specify request as post in java
@@amolgode9843 In Angular js use below code to send post request
var data = (id:123,age:20. email:'abc@email.com'};
$http({
url: "create-user",
method: "POST",
params: data
});
In Servlet use req.getParameter("id")....
@@codingboot455 thanks bro.. but i am using angular 12 not angular js. I just want to use angular with java servlet.
@@amolgode9843 It's super easy in angular 12, please go through the other video on coding boot.
czcams.com/video/zXyF0afXjlQ/video.html
Hy dear please i need method POST WITH YOUR METHOD COULD YOU HELP ME with THAT Submit form with POST method
do you want to send json data in post method ?
@@codingboot455 yeah... I want to send data of one page to other page .
Hi how do I call particular method from my spring MVC controller?
Do you want to call spring controller method from angularjs?
@@codingboot455 yes
Add @ResponseBody and
@GetMapping("/hello") on top of that method and from angularjs call this endpoint
hi sir i writing the same code as you but when i try to see the json data on the browser it does not work
What error getting in browser console can you post here ?
@@codingboot455 http status 404 not found type : status report description the origin server did not find a current representation for the target resource or is not willing to disclose that one exists
@@codingboot455 and in the console there is cross-Origin reauest blocked
Loading failed for the with source
@@mohammedoucif217 please check context path url and spelling mistake for 404
@@codingboot455 thanks but I find the solution it was my mistake I forgot to return the list I just left it null
You got email? Like your tutorial reply me asp!!
Thanks bro
@@codingboot455 geeyusto17@gmail.com