Solved

include variables in JSP forward.

Posted on 2003-11-12
10
1,990 Views
Last Modified: 2013-11-18

hi,
here i'm including two variables
 eg:monfname , time in a forwarded to a  page like below..

<jsp:forward
page="E:\\Reports\\"+monfname+"\\"+time +"\\"+index.html />

here monfname and time are folders and index.html is the file i want to load  thru jsp forward.

I do not have to use Virtual paths.

I try the above code but it shows error missing terms, invalid label etc..

can ayone help me to sort out this..
Thanks..
regards Arunkumar
0
Comment
Question by:rarunk
  • 4
  • 4
  • 2
10 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9731018
<jsp:forward page="/Reports/"+monfname+"/"+time +"/index.html" />

And Reports will have to be inside your webapps folder
0
 

Author Comment

by:rarunk
ID: 9731138
hi,
In my case the reports will not be in my Webapps.
It might be anywhere in any drive like d:/ or e:/

in that case how to do this?

Arun
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9731161
I don't think you can without setting up a virtual host thing...

page is a relative URL from the current page, not a fully qualified path to anywhere on your file system :-(
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 9732216
do you have to do a forward?  Can you include the file by reading it in using java.io.File API.

CJ
0
 

Author Comment

by:rarunk
ID: 9737161
Hi,

Actually what i'm getting the value of the
monfname , time  in the jsp page and after getting those i'm creating a path

like ..E:\Reports\monfname\time\index.html ..

The pgae i want to display is like

 E:\Reports\20032012\121314\index.html ...

As i have the value for monfname and time..it should be exactly as above..
Now i want  to show the above html page...
How to do it? I think i have to do it thru <Jsp:forward>
If i can show it in any other way...
Your supports are welcome...
regards Arun.



0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 35

Expert Comment

by:TimYates
ID: 9738336
Do it like cheekycj suggested...

Use a FileReader to read the file, and write it to the out stream
0
 

Author Comment

by:rarunk
ID: 9739626
Hi,

No i don't want to use  filereader.
The issue is because of the root path.

So can any one suggest how to change the document root path .
Is it possible?                  
 and get the points for this question.

regards
Arun


0
 
LVL 35

Accepted Solution

by:
TimYates earned 35 total points
ID: 9740123
it's in server.xml if you are using tomcat...

I wouldn't recommend this though...  it will mean that your entire drive is visible via the web...
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 9740146
What TimYates suggested is correct, I thought you wanted something programmatically but I do not believe that is possible.

CJ
0
 

Author Comment

by:rarunk
ID: 9745190

Hi CJ & TimYates..

Thanks for your Suggesstion. I want to share the Points to both of you.
But the application accept only one as a Accept Answer.
Anyway Thanks to both of you for your kind support.

regards
Arun
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to count occurrences of each item in an array.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now