Solved

include variables in JSP forward.

Posted on 2003-11-12
10
1,989 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

11 Experts available now in Live!

Get 1:1 Help Now