Reputation: 1
i am new to jsp, I am currently studying an example i got from online. some tags confused me.
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<link href="<s:url value="/resources/main.css"/>" rel="stylesheet" type="text/css"/>
<title><s:text name="label.employees"/></title>
</head>
<body>
<div class="titleDiv"><s:text name="application.title"/></div>
<h1><s:text name="label.employees"/></h1>
Thank you very much for your help.
Upvotes: 0
Views: 90
Reputation: 54796
On lines 6 and 9, the "label.employees" and "application.title" strings are parameters being passed to the Struts text
tag. This is not defining a new variable, rather it is telling the Struts tag which already-defined variable it should consult in order to find the text that it is supposed to show.
As for "titleDiv", that is just a standard CSS class name. It has nothing to do with JSP or JSP tags. It works the same in a JSP page as it does in any standard HTML page.
You may find the reference documentation helpful.
Upvotes: 2