Results 1 to 6 of 6
Thread: Please correct this JSP code
- 06-13-2011, 09:35 AM #1
Member
- Join Date
- Jun 2011
- Posts
- 7
- Rep Power
- 0
Please correct this JSP code
Hi Friends,
I have created one JSP page which will do the following things:
1) while opening, it will call UNIX shell script, this internally creates one zip file.
2) Once this job is completed, it should display a hyper link. When the user click on this link it should give that zip file as pop-up.
in my code , my hyper link is displaying like a normal text. ( 'click here' is not activated as hyper link displaying )
Here is the code:
Please help me to correct this code?Java Code:<%@page language="java" %> <%@page import="java.util.*" %> <html> <h1 style="font-family: Georgia; font-style:italic; font-size: 16px; color: #44BDE8;">Submitted your request to server </h1> <marquee behavior="scroll" direction="left" style="font-family: Arial; font-style:italic; font-size: 14px; color: #B7D1DA;" >Processing ..!! Processing ..!! </marquee> <head> <% String unixCommand = "sh /home/dev/raj/java/parse_all.ksh"; Runtime rt = Runtime.getRuntime(); Process p = rt.exec(unixCommand); p.waitFor(); //String sLink = http://272.17.34.204:7777/tools/ready_files.zip if (p.exitValue() == 0) { System.out.println("+"); out.write("< a href=\"http://272.17.34.204:7777/tools/ready_files.zip\">Click Here</a>"); } else { System.out.println("-"); } %> </head> <body> </body> </html>
Regards,
Rajesh
- 06-13-2011, 10:25 AM #2
Hi. Maybe It has a mistake in this
. Just delete a space.< aSkype: petrarsentev
http://TrackStudio.com
- 06-13-2011, 10:53 AM #3
Member
- Join Date
- Jun 2011
- Posts
- 7
- Rep Power
- 0
Thanks Petr.
After doing the above change, i am getting error as follows:
Error :
[jsp src:line #:23]
')' expected. out.write("Click Here");
- 06-13-2011, 11:01 AM #4
Can you show your new variant )? I prefer to make it like that
Java Code:<% String link = ""; %> <a href="<%=link%>">Text</a>
Skype: petrarsentev
http://TrackStudio.com
- 06-13-2011, 11:34 AM #5
Member
- Join Date
- Jun 2011
- Posts
- 7
- Rep Power
- 0
Hi Petr,
I have tried this, but throwing lot of errors :(
if u dont mind can u give me the complete code(error free)?
Regards,
Rajesh
- 06-13-2011, 12:12 PM #6
Oh. I noticed you located your code in head tags html. You must change it on body tags.
Java Code:<%@page language="java" %> <%@page import="java.util.*" %> <html> <h1 style="font-family: Georgia; font-style:italic; font-size: 16px; color: #44BDE8;">Submitted your request to server </h1> <marquee behavior="scroll" direction="left" style="font-family: Arial; font-style:italic; font-size: 14px; color: #B7D1DA;" >Processing ..!! Processing ..!! </marquee> <head> </head> <% String unixCommand = "sh /home/dev/raj/java/parse_all.ksh"; Runtime rt = Runtime.getRuntime(); Process p = rt.exec(unixCommand); p.waitFor(); String sLink = http://272.17.34.204:7777/tools/ready_files.zip boolean result = p.exitValue() == 0; %> <body> <a href="<%=result ? link : "#"%>">Click here</a> </body> </html>Last edited by Petr; 06-13-2011 at 12:17 PM.
Skype: petrarsentev
http://TrackStudio.com
Similar Threads
-
Please help - can't seem to correct this...
By jmjbreezin in forum New To JavaReplies: 7Last Post: 05-09-2011, 01:39 PM -
keyTyped is it correct
By aizen92 in forum New To JavaReplies: 18Last Post: 04-03-2011, 01:47 PM -
Code seems to be correct, but why does it sometimes go wrong?
By Beginner in forum New To JavaReplies: 10Last Post: 06-06-2010, 10:12 AM -
Are my comments correct?
By twiggy62 in forum New To JavaReplies: 2Last Post: 02-08-2010, 05:34 AM -
Beginner Spring with Hibernate integrated. Is this code correct
By pestilencia in forum Web FrameworksReplies: 1Last Post: 10-24-2009, 02:13 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks