Java-Servlets | Java-Servlets | HTTP library
kandi X-RAY | Java-Servlets Summary
kandi X-RAY | Java-Servlets Summary
Java-Servlets
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Process a POST request
- Handle a GET request
- Get the JSP
- Display the servlet
- Handle the login form
- Displays a GET request
- Prints the application
- Main service method
- Display the example
- Post method
- Posts a user
Java-Servlets Key Features
Java-Servlets Examples and Code Snippets
Community Discussions
Trending Discussions on Java-Servlets
QUESTION
I have Two Tables in my database one is Syncbill
and other is Paymentmode
in Syncbill
. I have several columns which are representing the payment type for example cash, Paytm and others are Otherpayment1
,OtherPayment2
and so on.
I have one more table in my database named as paymentmode
where otherpayment mode names are defined like OtherPayment1
is defined as swiggy there.
Table syncbill
Table Paymentmode
resultant Table/Output
I am trying to get if it is done by query
Issue I am facing is:
- There is no relation between these two tables
- The relation I have made is in
Paymentmode
table there are four columns named asPosition
,Paymentcode
,Paymentname
andIsActive
where position is defined as 1,2,3,4 and so on, so these 1,2,3... and in other tableOtherpayment1
,Otherpayment2
.. here 1,2,3 are defining payment modes now what I am trying to do is to get data from both tables but as the place of
Otherpayment1
I want what is in other table (Paymentmode
) at position 1As in table
Paymentmode
I have a columnIsActive
so I want to get only thosePaymentNames
which hasIsActive='Y'
- I am not getting any idea how can I do that, I am posting this one to get an approach like how can I do that, it can be done with the query itself or I have to use server-side language I am using Java-Servlets as server-side language
What I was doing earlier:
I am writing this query:
...ANSWER
Answered 2019-Apr-12 at 09:22This can be done by using 2 sql queries
QUESTION
I am working on ajax for getting data from my server as back-end i am using java-servlets
Now what issues i am facing is:
- i have to call two data for two different work via ajax
- So what i am doing currently is creating two servlet class and making two ajax call to both of them
- i am writing all my codes in
doGet
method of one servlet - and via ajax call in
url
i am giving servlet class name
What i am trying to do
- can't i create one servlet and inside it i can make several methods and make ajax call on that servlet class method
what i am doing
Servlet1 code
...ANSWER
Answered 2019-Feb-08 at 11:06There isn't a good solution for HttpServlet classes, as you can only have one doGet
method. A decent workaround would be adding a parameter in your url, for example Servlet1?action=action1
and then implementing logic in your doGet()
method to decide what to do based on that parameter. For example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Java-Servlets
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page