Reputation: 23035
We have static HTML files which are outside of the WAR file. The files are "index.html", "about_us.html", "news.html". Lets say our war file name is "MyWarProject". Right now we launch the tomcat and directly access the WAR file using
localhost:8080/MyWarProject/
After we host it, the lcoalhost part will be replaced by a domain name.
But what we actually need is that user first access the "index.html", after that he click on "SIGN-UP" button to access the WAR file. How can I do this?
Upvotes: 0
Views: 789
Reputation: 23035
Actually, WAR files get unzipped inside the webapps folder and we can simply deal with HTML files after that. If the HTML is not highly affecting the rest, we can even add/remove them without issue.
Upvotes: 1
Reputation: 4516
You can navigate to the signup page by redirect the user via javascript. Example code below. Provide a button to the user on index.html on click the flow hits the signup page
index.html
<!DOCTYPE html>
<html>
<head>
<script>
function moveToSignUp() {
window.location.assign("http://yourdomain/signup.jsp")
}
</script>
</head>
<body>
<input type="button" value="Move to SignUp" onclick="moveToSignUp()">
</body>
</html>
Upvotes: 0
Reputation: 2801
How's about host the HTML files in another context (e.g., localhost:8080/HTMLProject/) and you can have a link in the index.html to the "MyWarProject"
For that, you just have to create a new folder inside Tomcat's webapps for HTMLProject
Upvotes: 0