You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Maya Muchnik <mm...@pumatech.com> on 2001/02/26 17:47:54 UTC

"hide" a link or JSP's URL

Hi,

How make a link or JSP URL "invisible" to a browser? I have read some chapter
in a book, I know that this is possible. Is it possible with Struts?  Is it
some property "visible=true / false"?

The second question is about "input" parameter in "Action Mapping" section of
struts-config.xml. For example, struts-example has no "input" for "Edit user
registration", but has "forward" for "success". On the other hand, "A walking
tour of the example application"
(http://localhost:8080/struts-example/tour.htm) has both (paragraph
"CheckLoginTag.java":
-------
            <!-- Edit user registration -->
            <action path="/editRegistration"
            type="org.apache.struts.example.EditRegistrationAction"
            name="registrationForm"
            scope="request"
            validate="false"
            input="/registration.jsp">
            <forward name="success" path="/registration.jsp"/>
            </action>
------
What is right?

Maya


Re: "hide" a link or JSP's URL

Posted by Craig Tataryn <Cr...@msdw.com>.
Honestly, I think it's just a matter of personal preference.  I've never used
"input", I always use forwards.

Craig T.

Maya Muchnik wrote:

> Thank you very much. What about the 2nd Q?
>
> Craig Tataryn wrote:
>
> > You have to add some javascript to your link that gets fired when the
> > "onmouseover" event happens...
> >
> > <a href="javascript:void(0)" onMouseOver="(window.status=''); return true">
> >
> > Craig T.
> >
> > Maya Muchnik wrote:
> >
> > > Hi,
> > >
> > > How make a link or JSP URL "invisible" to a browser? I have read some chapter
> > > in a book, I know that this is possible. Is it possible with Struts?  Is it
> > > some property "visible=true / false"?
> > >
> > > The second question is about "input" parameter in "Action Mapping" section of
> > > struts-config.xml. For example, struts-example has no "input" for "Edit user
> > > registration", but has "forward" for "success". On the other hand, "A walking
> > > tour of the example application"
> > > (http://localhost:8080/struts-example/tour.htm) has both (paragraph
> > > "CheckLoginTag.java":
> > > -------
> > >             <!-- Edit user registration -->
> > >             <action path="/editRegistration"
> > >             type="org.apache.struts.example.EditRegistrationAction"
> > >             name="registrationForm"
> > >             scope="request"
> > >             validate="false"
> > >             input="/registration.jsp">
> > >             <forward name="success" path="/registration.jsp"/>
> > >             </action>
> > > ------
> > > What is right?
> > >
> > > Maya
> >
> > --
> > I've been trying to change the world for years, but they just won't give me the
> > source code....

--
I've been trying to change the world for years, but they just won't give me the
source code....


Re: "hide" a link or JSP's URL

Posted by Maya Muchnik <mm...@pumatech.com>.
Thank you very much. What about the 2nd Q?

Craig Tataryn wrote:

> You have to add some javascript to your link that gets fired when the
> "onmouseover" event happens...
>
> <a href="javascript:void(0)" onMouseOver="(window.status=''); return true">
>
> Craig T.
>
> Maya Muchnik wrote:
>
> > Hi,
> >
> > How make a link or JSP URL "invisible" to a browser? I have read some chapter
> > in a book, I know that this is possible. Is it possible with Struts?  Is it
> > some property "visible=true / false"?
> >
> > The second question is about "input" parameter in "Action Mapping" section of
> > struts-config.xml. For example, struts-example has no "input" for "Edit user
> > registration", but has "forward" for "success". On the other hand, "A walking
> > tour of the example application"
> > (http://localhost:8080/struts-example/tour.htm) has both (paragraph
> > "CheckLoginTag.java":
> > -------
> >             <!-- Edit user registration -->
> >             <action path="/editRegistration"
> >             type="org.apache.struts.example.EditRegistrationAction"
> >             name="registrationForm"
> >             scope="request"
> >             validate="false"
> >             input="/registration.jsp">
> >             <forward name="success" path="/registration.jsp"/>
> >             </action>
> > ------
> > What is right?
> >
> > Maya
>
> --
> I've been trying to change the world for years, but they just won't give me the
> source code....


Re: "hide" a link or JSP's URL

Posted by Craig Tataryn <Cr...@msdw.com>.
You have to add some javascript to your link that gets fired when the
"onmouseover" event happens...

<a href="javascript:void(0)" onMouseOver="(window.status=''); return true">

Craig T.

Maya Muchnik wrote:

> Hi,
>
> How make a link or JSP URL "invisible" to a browser? I have read some chapter
> in a book, I know that this is possible. Is it possible with Struts?  Is it
> some property "visible=true / false"?
>
> The second question is about "input" parameter in "Action Mapping" section of
> struts-config.xml. For example, struts-example has no "input" for "Edit user
> registration", but has "forward" for "success". On the other hand, "A walking
> tour of the example application"
> (http://localhost:8080/struts-example/tour.htm) has both (paragraph
> "CheckLoginTag.java":
> -------
>             <!-- Edit user registration -->
>             <action path="/editRegistration"
>             type="org.apache.struts.example.EditRegistrationAction"
>             name="registrationForm"
>             scope="request"
>             validate="false"
>             input="/registration.jsp">
>             <forward name="success" path="/registration.jsp"/>
>             </action>
> ------
> What is right?
>
> Maya

--
I've been trying to change the world for years, but they just won't give me the
source code....


Re: "hide" a link or JSP's URL

Posted by Maya Muchnik <mm...@pumatech.com>.
Thank you both, Craig M. and Craig T. very much!
Maya

"Craig R. McClanahan" wrote:

> Maya Muchnik wrote:
>
> > Hi,
> >
> > How make a link or JSP URL "invisible" to a browser? I have read some chapter
> > in a book, I know that this is possible. Is it possible with Struts?  Is it
> > some property "visible=true / false"?
> >
>
> Another Craig knew the JavaScript trick for this one :-).
>
> >
> > The second question is about "input" parameter in "Action Mapping" section of
> > struts-config.xml. For example, struts-example has no "input" for "Edit user
> > registration", but has "forward" for "success". On the other hand, "A walking
> > tour of the example application"
> > (http://localhost:8080/struts-example/tour.htm) has both (paragraph
> > "CheckLoginTag.java":
> >
>
> I suspect this part of the walking tour was based on an older version of
> the
> example code.
>
> > -------
> >             <!-- Edit user registration -->
> >             <action path="/editRegistration"
> >             type="org.apache.struts.example.EditRegistrationAction"
> >             name="registrationForm"
> >             scope="request"
> >             validate="false"
> >             input="/registration.jsp">
> >             <forward name="success" path="/registration.jsp"/>
> >             </action>
> > ------
> > What is right?
> >
>
> The "official" version of the example (that is, the code that is
> actually
> executed when you run the example), does not have an "input" attribute
> on the
> "/editRegistration" action.  The reasoning is this:  the
> "/editRegistration"
> action is never used as the target of a form submit, so there is no
> concept of
> returning to an input form after a validation error.  This action is
> invoked to
> "set up" a new form bean before transferring to "registration.jsp" for
> entry, so
> there is no need for input processing before it is invoked.
>
> One of the places that "/editRegistration.do" is referenced is on the
> main menu
> page -- it is the destination of the hyperlink for the "Edit your user
> registration profile".  So, if we follow through on what happens when
> you run the
> app:
> (1) Log on and go to the main menu.
> (2) Click the hyperlink for "/editRegistration.do"
> (3) This action sets up a form bean, populated from your current
>     user information.
> (4) This action returns a forward to the "success" page,
> registration.jsp
> (5) The registration page displays, accepts your input,
>     and submits to the "/saveRegistration" action
> (6) This action has an input form declared, so the validation occurs.
>     If there are any errors, returns to (5) with the error messages
> object
>     created
> (7) If there are no errors, the save registration action is called.
>
> So, you should use an "input" attribute only on actions that actually
> accept an
> input form (and therefore might detect validation errors and need to
> return).
> Actions that don't do this do not need an "input" attribute.
>
> >
> > Maya
>
> Craig


Re: "hide" a link or JSP's URL

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Maya Muchnik wrote:

> Hi,
>
> How make a link or JSP URL "invisible" to a browser? I have read some chapter
> in a book, I know that this is possible. Is it possible with Struts?  Is it
> some property "visible=true / false"?
>

Another Craig knew the JavaScript trick for this one :-).

>
> The second question is about "input" parameter in "Action Mapping" section of
> struts-config.xml. For example, struts-example has no "input" for "Edit user
> registration", but has "forward" for "success". On the other hand, "A walking
> tour of the example application"
> (http://localhost:8080/struts-example/tour.htm) has both (paragraph
> "CheckLoginTag.java":
>

I suspect this part of the walking tour was based on an older version of
the
example code.




> -------
>             <!-- Edit user registration -->
>             <action path="/editRegistration"
>             type="org.apache.struts.example.EditRegistrationAction"
>             name="registrationForm"
>             scope="request"
>             validate="false"
>             input="/registration.jsp">
>             <forward name="success" path="/registration.jsp"/>
>             </action>
> ------
> What is right?
>

The "official" version of the example (that is, the code that is
actually
executed when you run the example), does not have an "input" attribute
on the
"/editRegistration" action.  The reasoning is this:  the
"/editRegistration"
action is never used as the target of a form submit, so there is no
concept of
returning to an input form after a validation error.  This action is
invoked to
"set up" a new form bean before transferring to "registration.jsp" for
entry, so
there is no need for input processing before it is invoked.

One of the places that "/editRegistration.do" is referenced is on the
main menu
page -- it is the destination of the hyperlink for the "Edit your user
registration profile".  So, if we follow through on what happens when
you run the
app:
(1) Log on and go to the main menu.
(2) Click the hyperlink for "/editRegistration.do"
(3) This action sets up a form bean, populated from your current
    user information.
(4) This action returns a forward to the "success" page,
registration.jsp
(5) The registration page displays, accepts your input,
    and submits to the "/saveRegistration" action
(6) This action has an input form declared, so the validation occurs.
    If there are any errors, returns to (5) with the error messages
object
    created
(7) If there are no errors, the save registration action is called.

So, you should use an "input" attribute only on actions that actually
accept an
input form (and therefore might detect validation errors and need to
return).
Actions that don't do this do not need an "input" attribute.

>
> Maya

Craig