?
Solved

default home page

Posted on 2004-11-12
10
Medium Priority
?
170 Views
Last Modified: 2010-04-01
Greetings oh great ones.

I am working with Struts.  I need to tell the application that the home page is index.do and not index.jsp.

The reason being is that index.jsp has some beans which need to be set before the user gets there.  

There is no login required at this time.

When the user clicks on links in the index page, different data is displayed, but when they initially get there, there is no data to display.

I did not want to create another page to show the initial form, and hope I can just do it in the struts-config file.

0
Comment
Question by:rg20
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 12566044
Try adding to WEB-INF/web.xml :

  <welcome-file-list>
    <welcome-file>index.do</welcome-file>
  </welcome-file-list>

other wise, you'll need to add an index.jsp page that contains just:

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:redirect href="index.do"/>


0
 
LVL 9

Author Comment

by:rg20
ID: 12566179
When I add the welcome file list to the web.XML  Which by the way I was looking for earlier and could not find it in the struts-config.  It just shows me a list of the files on the web page.  

It seems that the servlets are not activated at that time.

I am going to play with that for a while and see if I can get it to work.  I will look at the second choice if all else fails.

Thanks.

0
 
LVL 9

Author Comment

by:rg20
ID: 12566931
In your redirect, does it assume that index.do is a file or is it addressing the action class?
Thanks
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:kiranhk
ID: 12566999
try this for your action

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<logic:forward name="index.do"/>
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12567043
>  In your redirect, does it assume that index.do is a file or is it addressing the action class?

the latter...  it will call the action class for "index.do" referenced in the struts-config.xml

> try this for your action

That's *exactly* what I put kiranhk... you just use forward rather than redirect...  ;-)
0
 
LVL 8

Expert Comment

by:kiranhk
ID: 12567070
yes if its a action the forward is to be preferred!!!!!
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12567118
why?  This is an initial jsp which just sends control to the first struts action...
0
 
LVL 9

Author Comment

by:rg20
ID: 12585926
It turns out that you can access the actionform before the page is loaded as long as you set one of the variables in the action form to "".  

Once you do that, the bean will be created on startup.  So a second page is not necessary.
you can then use the bean:write method to call the data using the actionform name.

<bean:write name="actionform" property="propertyname" />


Thanks for all your help anyway.

0
 

Accepted Solution

by:
PAQ_Man earned 0 total points
ID: 13675858
PAQed with points refunded (50)

PAQ_Man
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Currently, there is an issue with being able to copy values from an external application to a dropdown list in Project Web Access (PWA).  The standard copy and paste methods don't seem to work properly. Here is a way to accomplish this task to s…
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 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