473,508 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML Target Tags in JSF...

Dököll
2,364 Recognized Expert Top Contributor
Hey Gang!

I thought I had a good idea but then I realized JSF doesn't play that...

I am trying to mimick what HTML can do in JSF when using target tags to related to inner HTML pages. In orther to get to a links going smoothly in JSF, on would do:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@ page contentType="text/html" %>
  3. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
  4. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  5.  
  6. <f:view>
  7. <html>
  8.      <head><title>jsf h:commandLink example</title></head>
  9.  
  10.      <body>
  11.           <h:form>
  12.                  <h:commandLink value="Click here for Homepage"       
  13.                               action="HomePage" />
  14.           </h:form>
  15.      </body>
  16. </html>
  17. </f:view>
  18.  
  19.  
This works great with the body of your JSF enabled JSP page. But in the case you need to use marginal links to fire such pages, as in frames from HTML pages, one would do:

Index.html

[code=HTML]

<html>
<head>

<title>Just Music </title>

</head>


<!--Company logo-->
<frameset rows=" 90,*">
<frame noresize="noresize" src="rhlg.html" scrolling="no">
<!--Company link-->
<frameset cols=" 200,*">
<frame noresize="noresize" src="link.html" scrolling="scrolling">
<!--Company body-->
<frame noresize="noresize" src="default.html" name="colours" marginheight="0" marginwidth="10">
</frameset>
</frameset>
</html>


link.HTML

The link page in turn would have something like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <body bgcolor="#CCCCCC" onload="RotateIt()">
  3.  
  4. ....
  5.  
  6. <table  align="center" border="0" cellspacing="0" cellpadding="2" rules="cols" width="70" height="20" bgcolor="gray">
  7.     <tr bgcolor="red">
  8.         <td bgcolor="#D3D3D3" colspan="2"><br>
  9. <center><font size="-1">    
  10. <a href="default.html" target="colours">Dököll Home</a><br>
  11. <a href="sched103.html" target="colours">Schedule</a>    
  12. <br>
  13. <a href="MediaPlaylist.html" target="colours">Media Playlist</a>    
  14. <br>
  15. <a href="Usolutes.html" target="colours">Company info</a>
  16. <br>
  17. <a href="UAccessor.html" target="colours">Dj Accessories</a>
  18. <br>
  19. <a href="Upinskeys.html" target="colours">Pins & Keys</a>    
  20. <br>
  21. <a href="UPhanthomDjListBox.html" target="colours">Goods/Services</a>
  22. <br>
  23. <a href="UEmail.html" target="colours">Send Email</a></center>
  24.  
  25. </font>    </p><center>
  26.  
  27.  
....


The default page would be the HomePage...

On e links are accessed through link.HTML, the inner HTML frame would display HomePage.HTML.

Th problem is getting JSF to mimick this effortlessly, what I get is an additional window when you using:

Expand|Select|Wrap|Line Numbers
  1. <f:view>
  2. <html>
  3.      <head><title>jsf h:commandLink example</title></head>
  4.  
  5.      <body>
  6.           <h:form>
  7.                  <h:commandLink value="Click here for Homepage"       
  8.                               action="HomePage" />
  9.           </h:form>
  10.      </body>
  11. </html>
  12. </f:view>
  13.  
  14.  
I cannot find a translation to from target="colours" in HTML to JSF.

Any input you have is appreciated.

Happy Sunday!

Dököll
Nov 16 '08 #1
4 10094
Dököll
2,364 Recognized Expert Top Contributor
I am getting warmer, get a look at the resemblance, quite fetching isn't it?

http://bytes.com/forum/thread560013.html
Nov 18 '08 #2
Dököll
2,364 Recognized Expert Top Contributor
Getting there, a bit stuck. The link in the navigation area is not working properly. Seems stuck:
link.jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Navigational Links</title>
  9. </head>
  10. <body>
  11. <f:view>
  12.           <h:form> 
  13.                  <h:commandLink value="Click here for Homepage"        
  14.                               action="retrieve_success" /> 
  15.           </h:form> 
  16. </f:view>
  17. </body>
  18. </html>
  19.  
  20.  
we need a header, I did not add any text yet, just generated code. But the link above does not seem to work, I will also post the errors much after:

header.jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Header File</title>
  9. </head>
  10. <body>
  11. <f:view>
  12.  
  13. </f:view>
  14. </body>
  15. </html>
  16.  
  17.  
again, it's nothing fancy, just generated code, then retrieve_page.jsp as the body of the new page, which in the case is a log in page:

retrieve_page.jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Log In Form</title>
  9. </head>
  10. <body>
  11. <f:view>
  12.             <h:form>
  13.                 <table>
  14.                     <tr>
  15.                         <td><h:outputText value
  16. ="Enter Login ID: " /></td>
  17.                         <td><h:inputText id=
  18. "UserID" value="#{RetrieveBean.UserID}" /></td>
  19.                     </tr>
  20.                     <tr>
  21.                         <td><h:outputText value=
  22. "Enter Password: " /></td>
  23.                         <td><h:inputSecret id=
  24. "UserPswrd" value="#{RetrieveBean.UserPswrd}" ></h:inputSecret></td>
  25.                     </tr>
  26.                     <tr>
  27.                         <td>&nbsp;</td>
  28.                         <td><h:commandButton value=
  29. "Enter here" action="#{RetrieveBean.GetValidLoginData}" /></td>
  30.                     </tr>
  31.                 </table>
  32.             </h:form>
  33.  
  34. </f:view>
  35. </body>
  36. </html>
  37.  
  38.  
here is what makes it all work, just like html but with some tweecking, it looks like I'll have what I need. But I need your help, I think I am too burned out;-(

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  3. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  4. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  9. <title>ReloadPage</title>
  10. </head>
  11.  <f:view>
  12.  <frameset rows="46,*" frameborder="yes" framespacing="0" border="2">
  13.     <frame src=" header.jsf"  name="header" scrolling="no" noresize="noresize"/>
  14.      <frameset cols="20%,80%" border="2" frameborder="no" framespacing="2" > 
  15.          <frame src="navtree.jsf" name="navigation" scrolling="yes" frameborder="no" noresize="noresize"/>
  16.          <frameset rows="90%,22" frameborder="no" framespacing="0"> 
  17.          <frame src="retrieve_page.jsf" name="navigation" frameborder="no" scrolling="yes" frameborder="no" noresize="noresize"/>
  18.          </frameset>
  19.      </frameset>
  20.  </frameset>
  21.  </f:view>
  22. </html>
  23.  
  24.  

All work well except the link part, the first bit of code {"action="retrieve_success} seems simple but I just can't quite put my finger on it:

Here are some of the errors, they don't seems to be English:-)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Nov 18, 2008 1:36:14 AM com.sun.faces.application.NavigationHandlerImpl getViewId
  3. WARNING: "JSF1013: Unable to find matching navigation case from view ID '/link.jsp' for outcome 'retrieve_success' and action 'retrieve_success'
  4.  
  5.  
Any guidance you have is greatly appreciated...

actually, this "for outcome 'retrieve_success' and action 'retrieve_success'" is telling me something, seems a little funky sounding:-)

Thanks again!
Nov 18 '08 #3
Dököll
2,364 Recognized Expert Top Contributor
Getting there, a bit stuck. The link in the navigation area is not working properly. Seems stuck:
link.jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Navigational Links</title>
  9. </head>
  10. <body>
  11. <f:view>
  12.           <h:form> 
  13.                  <h:commandLink value="Click here for Homepage"        
  14.                               action="retrieve_success" /> 
  15.           </h:form> 
  16. </f:view>
  17. </body>
  18. </html>
  19.  
  20.  
we need a header, I did not add any text yet, just generated code. But the link above does not seem to work, I will also post the errors much after:

header.jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Header File</title>
  9. </head>
  10. <body>
  11. <f:view>
  12.  
  13. </f:view>
  14. </body>
  15. </html>
  16.  
  17.  
again, it's nothing fancy, just generated code, then retrieve_page.jsp as the body of the new page, which in the case is a log in page:

retrieve_page.jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  2. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  3. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  8. <title>Log In Form</title>
  9. </head>
  10. <body>
  11. <f:view>
  12.             <h:form>
  13.                 <table>
  14.                     <tr>
  15.                         <td><h:outputText value
  16. ="Enter Login ID: " /></td>
  17.                         <td><h:inputText id=
  18. "UserID" value="#{RetrieveBean.UserID}" /></td>
  19.                     </tr>
  20.                     <tr>
  21.                         <td><h:outputText value=
  22. "Enter Password: " /></td>
  23.                         <td><h:inputSecret id=
  24. "UserPswrd" value="#{RetrieveBean.UserPswrd}" ></h:inputSecret></td>
  25.                     </tr>
  26.                     <tr>
  27.                         <td>&nbsp;</td>
  28.                         <td><h:commandButton value=
  29. "Enter here" action="#{RetrieveBean.GetValidLoginData}" /></td>
  30.                     </tr>
  31.                 </table>
  32.             </h:form>
  33.  
  34. </f:view>
  35. </body>
  36. </html>
  37.  
  38.  
here is what makes it all work, just like html but with some tweecking, it looks like I'll have what I need. But I need your help, I think I am too burned out;-(


index.jsp
Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
  3. <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
  4. <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  9. <title>ReloadPage</title>
  10. </head>
  11.  <f:view>
  12.  <frameset rows="46,*" frameborder="yes" framespacing="0" border="2">
  13.     <frame src=" header.jsf"  name="header" scrolling="no" noresize="noresize"/>
  14.      <frameset cols="20%,80%" border="2" frameborder="no" framespacing="2" > 
  15.          <frame src="link.jsf" name="navigation" scrolling="yes" frameborder="no" noresize="noresize"/>
  16.          <frameset rows="90%,22" frameborder="no" framespacing="0"> 
  17.          <frame src="retrieve_page.jsf" name="navigation" frameborder="no" scrolling="yes" frameborder="no" noresize="noresize"/>
  18.          </frameset>
  19.      </frameset>
  20.  </frameset>
  21.  </f:view>
  22. </html>
  23.  
  24.  

All work well except the link part, the first bit of code {"action="retrieve_success} seems simple but I just can't quite put my finger on it:

Here are some of the errors, they don't seems to be English:-)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Nov 18, 2008 1:36:14 AM com.sun.faces.application.NavigationHandlerImpl getViewId
  3. WARNING: "JSF1013: Unable to find matching navigation case from view ID '/link.jsp' for outcome 'retrieve_success' and action 'retrieve_success'
  4.  
  5.  
Any guidance you have is greatly appreciated...

actually, this "for outcome 'retrieve_success' and action 'retrieve_success'" is telling me something, seems a little funky sounding:-)

Thanks again!
Bingo Folks, Bing-Freaking-Go!

Told you I was tired, here's the scoop, I forgot to also name it colours, while calling olours:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <f:view> 
  3.  <frameset rows="46,*" frameborder="yes" framespacing="0" border="2"> 
  4.     <frame src=" header.jsf" scrolling="no" noresize="noresize"/> 
  5.      <frameset cols="20%,80%" border="2" frameborder="no" framespacing="2" >  
  6.          <frame src="link.jsf"  scrolling="yes" frameborder="no" noresize="noresize"/> 
  7.          <frameset rows="90%,22" frameborder="no" framespacing="0">  
  8.          <frame src="retrieve_page.jsf" name="colours" frameborder="no" scrolling="yes" frameborder="no" noresize="noresize"/> 
  9.          </frameset> 
  10.      </frameset> 
  11.  </frameset> 
  12.  </f:view> 
  13.  
That's it, that's all it was...

No errors... Unbelievable. Well, it's here now, others won't ahve to go through the turmoil:-)

In a bit!
Nov 20 '08 #4
Dököll
2,364 Recognized Expert Top Contributor
I must caution, a JSF tutorial is so needed before diving in to web apps, looking at my problem above, one would not know how to go through it an get it to work. Especially with my poor explaination of the problem.

Here's a reference on JSF: JavaServer Faces (JSF) Tutorial Net.
Nov 26 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

72
5301
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
3
9263
by: Christophe Guillon | last post by:
Hello I would like to have a hypertext link which, when I click on it, leads to a web page where a certain word is highlighted. Depending on the link, the same target page would be displayed but...
1
2424
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
1
2896
by: Rebecca Tsukalas | last post by:
hello, is there an official or a correct way for the following problem: in my xml file, there is also html text. this xml file is used in flash and a php code. the problem is, that - using...
2
1580
by: Fred Chateau | last post by:
Is there a problem with the HTML 4.01 schema in Visual Studio 2005? When I set the target schema for validation to HTML 4.01, I receive closing tag errors. Example: Validation (HTML 4.01):...
1
16932
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
4
6053
by: nothing1 | last post by:
Ok here is my question i hope its something easy. I have CMS that generates images from whatever url I put with its corresponding syntax. Well I want to add a Lightbox to does images but instead of...
0
569
by: Lars Eighner | last post by:
In our last episode, <004f629c$0$10265$c3e8da3@news.astraweb.com>, the lovely and talented mark4asp broadcast on comp.infosystems.www.authoring.html: I have not done this, not even on...
0
2773
by: Guy Macon | last post by:
Moon wrote: It isn't a question of relative vs. full URL paths in your meta tags. It is a question of following the paths (relative or full URL) in your meta tags vs. not reading the meta tags...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.