/    Sign up×
Community /Pin to ProfileBookmark

return to wrong page

i am creating my web site using jsp. the problem that is faced is when i click submit button after execute my page, it will return to wrong page. however i already type return to the relevant page in my program. how to make sure that after click submit button, my page will return to the relevant page. my program is using frame. Firstly, i select option from the list bar. after select, it will execute my program. unfortunately after execute it returned to the wrong page

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@KorApr 22.2004 — 
unfortunately after execute it returned to the wrong page
[/quote]


I dare to say that this is an error in your server-side application to which data is submit, not a javascript problem...

Anyway, even if you might have had a javascript redirectioning code, you must have show us here (or on server or on attachment, if too heavy) otherwise how can we give you a solution??
Copy linkTweet thisAlerts:
@jilshiauthorApr 22.2004 — at first i try there is no problem. when i add list bar for the user to choose, it will return to wrong page. there is no error occurs when no list bar is use. it will successfully return to the relevant page.

the problem is when add list bar for the user to choose, it will return to wrong page.
Copy linkTweet thisAlerts:
@KorApr 22.2004 — Can we see the code or relevenat part of your HTML & javascript code?
Copy linkTweet thisAlerts:
@jilshiauthorApr 23.2004 — <form name="form1" method="post" action="page1.jsp">

<% String propVal = request.getParameter("prop");

out.print(propVal);

if (propVal.equals("klcv")) {
//response.sendRedirect(response.encodeRedirectUrl("klcv_write_online_registration.jsp"));
String server = "localhost";
session.setAttribute("server", server);
String database = propVal;
session.setAttribute("database", database);

Class.forName("org.gjt.mm.mysql.Driver");
DriverManager.registerDriver((Driver) Class.forName("org.gjt.mm.mysql.Driver").newInstance());
String url = ("jdbc:mysql://"+server+"/"+database+"" );
Connection conn = (Connection)DriverManager.getConnection(url,"","");

String sql_1 = "SELECT * FROM smbyer INTO OUTFILE 'klcv_smbyer.txt' "+
"FIELDS TERMINATED BY '|' LINES TERMINATED BY 'rn' ";
Statement stmt_1 = conn.createStatement();
ResultSet rset_1 = stmt_1.executeQuery(sql_1);

conn.close();

} else if (propVal.equals("sv")) {
//response.sendRedirect(response.encodeRedirectUrl("sv_write_online_registration.jsp"));
String server = "localhost";
session.setAttribute("server", server);
String database = propVal;
session.setAttribute("database", database);

Class.forName("org.gjt.mm.mysql.Driver");
DriverManager.registerDriver((Driver) Class.forName("org.gjt.mm.mysql.Driver").newInstance());
String url = ("jdbc:mysql://"+server+"/"+database+"" );
Connection conn = (Connection)DriverManager.getConnection(url,"","");
String sql_1 = "SELECT * FROM smbyer INTO OUTFILE 'sv_smbyer.txt' "+
"FIELDS TERMINATED BY '|' LINES TERMINATED BY 'rn' ";
Statement stmt_1 = conn.createStatement();
ResultSet rset_1 = stmt_1.executeQuery(sql_1);

conn.close();

}

String brv= "brv";
session.setAttribute ("database", brv);%>

<h1>&nbsp;</h1>

<h1>&nbsp;</h1>

<META HTTP-EQUIV="refresh" CONTENT="2; URL=page1.jsp">

<h2 align="center"><font color="#000099">Data transfer completed!</font></h2>

</form>
Copy linkTweet thisAlerts:
@KorApr 23.2004 — This is not Javascript...
×

Success!

Help @jilshi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...