Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

include variables in JSP forward.

Posted on 2003-11-12
10
Medium Priority
?
2,000 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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 105 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

670 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