Antonio Goncalves created FORGE-2370:
----------------------------------------
Summary: Being able to create a new HTML Page
Key: FORGE-2370
URL:
https://issues.jboss.org/browse/FORGE-2370
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.16.2.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
At the moment the only way to generate HTML pages is with scaffolding. It would be good to
have a separate command to create HTML pages. Commands such as :
{code}
html-new-page --named mypage
{code}
This will create a mypage.html on the root of the webapp directory. You could also give a
different directory with :
{code}
html-new-page --named mypage --targetDirectory admin
{code}
This will create the page under webapp/admin/mypage.html.
{code}
<!DOCTYPE HTML>
<html>
<head>
<title>mypage</title>
</head>
<body>
<h1>mypage</h1>
</body>
</html>
{code}
The name of the page {{mypage}} is used for the title but we could customize it :
{code}
html-new-page --named mypage --title Administration Page
{code}
It would just generate the following HTML page :
{code}
<!DOCTYPE HTML>
<html>
<head>
<title>Administration Page</title>
</head>
<body>
<h1>Administration Page</h1>
</body>
</html>
{code}
If the page needs to be included in the {{welcome-file-list}} in the {{web.xml}} we could
:
{code}
html-new-page --named mypage --isWelcomePage
html-new-page --named mypage2 --isWelcomePage
{code}
{code}
<web-app>
<welcome-file-list>
<welcome-file>mypage.html</welcome-file>
<welcome-file>mypage2.html</welcome-file>
</welcome-file-list>
</web-app>
{code}
If we want a page that redirects to somewhere else, we just type :
{code}
html-new-page --named mypage --redirectsTo ./faces/index.xhtml
{code}
{code}
<!DOCTYPE HTML>
<meta http-equiv="refresh" content="0;url=./faces/index.xhtml"
/>
<html>
<head>
<title>mypage</title>
</head>
<body>
<h1>mypage</h1>
</body>
</html>
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)