Checkin for a specific username and password
i have an html page where i enter username and password..now if i want that for a specific username and password only the next page say next.html is displayed otherwise the same page is diaplayed sayin that the usrename and password is to be reenterd...how can i do this servlets..also do tell me where to store the username and password
I am sorry, I lost some code in cut and pasting it
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginServlet extends HttpServlet{
private Connection con;
private PreparedStatement pstmt;
private Statement stmt;
private ResultSet rs;
private String pass = "";
private String login,password,done;
private HttpSession session;
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException{
login = ""+request.getParameter("login");
password = ""+request.getParameter("password");
done = ""+request.getParameter("done");
session = request.getSession(true);
PrintWriter out = response.getWriter();
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
}catch(Exception e){
out.println(e.getMessage());
try{
con = DriverManager.getConnection("jdbc:oracle:thin:scott/[email protected]:1521:csapw");
if(!(password.equals("")&&login.equals(""))){
pstmt = con.prepareStatement("select password from logon where login = ?");
pstmt.setString(1,login);
rs = pstmt.executeQuery();
pass = "";
while(rs.next()){
pass = rs.getString(1);
if(pass.equals(password)){
session.setAttribute("login",login);
if(done.equals("null")){
done = "";
pass = "";
response.sendRedirect("/ksenji/quiz2/shoponline.jsp");
}else{
response.sendRedirect(done.substring(5));
else{
response.sendRedirect("/ksenji/quiz2/login.jsp?"+done);
else{
response.sendRedirect("/ksenji/quiz2/login.jsp?"+done);
}catch(SQLException ex){
out.println(ex.getMessage());
Similar Messages
-
Write code for authentication of username and password using struts
write code for authentication of username and password using session using struts with jdbc connection..
write code for authentication of username and
password using session using struts with jdbc
connection..and please, allow me to spoon feed you! -
My computer is authorized, but when I try to open a recently downloaded audio file I get asked for my "Audible username and password" and my AppleID and password do not work.
thats because audible isnt apple provided, its a third party app/website so you'll have to get it from them
-
Access document in Library is being asking for an Infopath username and password
Trying to get access to files in the library. And the user is having permissions but when he clicked the file in the library he is being ask for an Infopath username and password.
A pop dialog box showing like
"Form will open in Offline Mode"
You are currently working offline.
To try to connect to data sources when the form is opened, click "Try to Connect". To use previously stored data......
Can somebody reply on this please..Hi,
According to your post, my understanding is that access document in Library is being asking for an Infopath username and password.
Usually this error when the form is not connected to any of the data sources successfully. Please verify all the data connections are available or not.
I recommend to enable the options for Infopath Form Services to ensure that InfoPath 2010 is in online mode.
In addition, you can add your SharePoint server’s FQDN to your Trusted Sites or Intranet Sites zone and modify your registry settings for the WebClient service.
For more information, you can refer to:
Form will Open in Offline mode? Please help
How to ensure that Infopath 2010 is in online mode?
SharePoint Keeps Prompting for Credentials
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Firefox any version Mac, has a bug were it does not see or ask for the proxy username and password. This happens if you use a virtual tagged interface. A recent network University policy change. The only way to fix this, is if you use a manual proxy configuration in Firefox. So all 100 + uni iMac's can only use Safari as I would need to do a profile push to all 300 students and I am unsure what file carries the proxy information.
Firefox any version Mac, has a bug were it does not see or ask for the proxy username and password. This happens if you use a virtual tagged interface. A recent network University policy change. The only way to fix this, is if you use a manual proxy configuration in Firefox. So all 100 + uni iMac's can only use Safari as I would need to do a profile push to all 300 students and I am unsure what file carries the proxy information.
-
Using CreateObject for Webservice with username and password
When using createObject() to call a web service how do I pass
in the user name and password required by the service?
If I do a cfdump on the webservice object I see it has
setUserName() and setPassword() methods but they don't seem to be
working.
I also see there are properties named "USERNAME_PROPERTY" and
"PASSWORD_PROPERTY" but I can't seem to modify them in code. I
suppose they are protected.
example:
ws = createObject("webservice", "
http://url.to/wsdl.xml",
"serviceport");
ws.setUserName("myawesomeusername");
ws.setPassword("myawesomepassword");
myReturn = ws.serviceMethodCall("bla");quote:
Originally posted by:
MACRStockHolder
For anyone that encounters the same issue/question;
apparently you can't apply a username/password to the object call
like you can when using <cfinvoke> to make a web service
call.
FYI Adobe: this is VERY limiting, I have to use a web service
that uses in/out parameters which to the best of my knowledge
requires the use of createObject() but at the same time the web
service requires a username and password which I can only do with
<cfinvoke>. Looks like I will be writing a compiled custom
tag just for a workaround.
According to the docs you can provide a username and password
by passing a struct containing these items to CreateObject
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_c-d_18.html#45 14398
If you like cfinvoke use it. You can get return values by
using the returnVariable argument. I would assume mutliple output
parameters would be returned in a struct.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_i_10.html#4001127 -
Leopard prompts for 802.1X username and password instead of WEP password
hey!
so i got leopard on friday and i haven't been able to connect to my wireless properly since.
i have an old D-Link DI-624 (Revision B) router that i have protected with a WEP password. in tiger i never had any problems with this, but now instead of prompting me for a WEP password when i try to connect, leopard prompts me to enter username and password and below there is a dropdown entitled 802.1X with options automatic and TTLS-PAP.
if i try to enter my WEP password as the password, the connection fails.
i know that the issue is not the router because my girlfriend is still running tiger and has no issues.
i ran that login and keychain update and that didn't help. i also deleted that old airport driver file that other people had mentioned for other airport issues and that didn't do anything either.
any ideas??
thanks!!I have this exact same problem.
-
I have changed my username and password for my apple account but the apps previously linked to it are still asking for the old info. And I don,t know it so that's why I updated it
Apps are permanently tied to the ID and password used to purchase them. If you do not remember that information, you cannot update them. If you ned these apps, you will have to repurchase them under your new ID.
-
I can't update my apps in my iPad because it asks me to sign in to an outdated id which is different to my current Apple ID
Apps are always tied to the ID that was used to purchase them. If you bought the apps with old username and password, you have to continue to use them to update the apps.
If you changed the username because you got a new email address, sign out of your old ID in Settings>iTunes and App Store. Tap the old ID and sign out then sign in with the new/changed ID. -
Activation help!
I need to activate my 2nd hand Iphone by entering the apple iD and password used to set up icloud. My problem is that I have never set up icloud. I purchased the phone off the original owner almost 12 months ago and have recently experienced problems which required repairing.
The repairer apparently had to delete my iD I used to login to itunes and now is asking for icloud email and password.
Can someone help me please?The only solution is to contact the original owner. He will need to give you the info required. Apple will not help you circumvent the activation lock.
-
Will Apple ever ask for my iCloud username and password over a WITHELD number
My iPhone 5 was stolen last night (I have a rough idea who it was) and it was switched on, this morning when I got home to ring the phone it is now switched off, I had Find my iPhone app but forgot to put location services on.. so I can not track my iPhone, the iPhone has been wiped I think as today I recieved a call from a Witheld number asking for my name, date of birth. I gave these over and then the person on the phone said theres a new service out where if I give them my Apple ID and password they will be able to track my iPhone... I instantly thought that it was the people who took the phone. They rang my house number which is not on my iCloud account, however the person who I assume stole it has my house number.
So my question is, do Apple ever contact you asking for the ID and password?danyog1 wrote:
Location services were on and I did have it all linked etc, a few month ago I was able to trace my phone but I turned location services off.
If you turned location services off, then they were off.
It doesn't mater what you did a few months ago.
I can log into my iCloud account on my laptop... and see my iPhone which say's offline
If it shows Offline, then you have Locations servicesand FindMyiPhone enabled.
Offline simply means it is not online at this time
If they were disabled, you would not see the iPhone at under Devices.
Set it to Lost Mode to track it when it does come online
-> http://support.apple.com/kb/PH2700?viewlocale=en_US&locale=en_US -
Creative Cloud is asking for proxy server username and password - what is this?
how do I find out the proxy server username and password
Krisw30568123 do you utilize an authenticating proxy server? If so then you will need to enter the proper credentials to access the Internet.
-
Login prompt for username and password
GoodEvening!
I'm developing a web application using jsp technology.
When the user digit:
http://<machine address>:<port>/<applicationName>
I would that a browser prompt login is diplayed to the user for enter him username and password, before loading the index.jsp page. Is possible without using awt or swing components?! using only the browser's prompt dialog?!
p.s.
sorry 4 my bad english! ;-)You can use Apache ACLs, http://httpd.apache.org/docs/1.3/howto/auth.html
GoodEvening!
I'm developing a web application using jsp
technology.
When the user digit:
http://<machine address>:<port>/<applicationName>
I would that a browser prompt login is diplayed to
the user for enter him username and password,
before loading the index.jsp page. Is possible
without using awt or swing components?! using only
the browser's prompt dialog?!
p.s.
sorry 4 my bad english! ;-) -
Prompt for username and password when executing servlet
In Weblogic 5.1 when I set the username and password in weblogic.properties file, it prompts for the usertname and password when I execute the gatewayServlet
weblogic.allow.execute.weblogic.servlet.servlets/gateway.administration=vijay
weblogic.password.vijay=password
But I guess this is not the way it can be implemented in 8.1. Please let me know how I can prompt for username and password when executing the servlet. I dont want it to be done programatically. Please let me know whether I can set anything on the properties file.
Thanks
Vijay SubramanianYou can use Apache ACLs, http://httpd.apache.org/docs/1.3/howto/auth.html
GoodEvening!
I'm developing a web application using jsp
technology.
When the user digit:
http://<machine address>:<port>/<applicationName>
I would that a browser prompt login is diplayed to
the user for enter him username and password,
before loading the index.jsp page. Is possible
without using awt or swing components?! using only
the browser's prompt dialog?!
p.s.
sorry 4 my bad english! ;-) -
What are username and password for BPEL Console of BPEL Process Manager 10g
There was no hint for setting the username and password during installation.
HELP!!After installation of BPEL Process Manager .I can enter the BPEL admin page ,but not BPEL console page the http://192.168.1.100:9700/BPELConsole/j_security_check for the invalid default name and pass,neither bpeladmin nor oc4jadmin could be checked at all.
While,the BPEL PM SERVER console replyed me some messages like:invalid authorization method,should be CUSTOM_AUTH,but find FORM and realmLoginModule authentication failed
I need your help!really!!please!!thank you all!!!!!
Maybe you are looking for
-
Officejet Pro 251dw won't print with applications inside Parallels 9
I've used HP printers with my Mac computers for years and had no problems, even when I was working with Windows XP and Windows-based applications inside Parallels Desktop on the Mac. All I would have to do to have the Windows-based software capture t
-
Hi, I am using tomcat and put a ChatApplet.class under the directory ..../YYY/WEB-INF/classes/abc, and ChatApplet.class like this: package abc, public class ChatApplet extends Applet{ And a JSP under the /YYY/chat directory like this: <applet CODE=ab
-
Itunes has downloaded,asking which program to open with to finish dowload
Hi I have downloaded itunes on my computer and at the end to finish the download it asks me what program i want to use to open itunes. can anyone help me with this ? when i done this in the past the windows installer just loaded itunes ?
-
Why can't the bloody window get the right size?
I have a huge problem with graphical components... and I doubt that I'm alone with it. This concerns how to get the bloody windows to be laid out with the correct size. Java never wants to have the window sized as I set it. It's always different, and
-
Trouble in Modifying calculateMinorAxisRequirements() method of BoxView
Hi there, I have written a custom View, called TreeView that extends BoxView. Basically, my TreeView lays out all its children on y-axis (so it calls BoxView(element,View.Y_AXIS) in constructor), and displays all its children (except the first and th