... importance and utility of application development frameworks.
2. What Yii is and the characteristics of Yii that make it incredibly powerful
and useful.
3. The MVC applicationarchitectureand the ... Yii
•
WebRoot
is congured as the document root of your web server
• From your command line, change to your
WebRoot
folder and execute
the following:
% cd WebRoot
% YiiRoot/framework/yiic webapp ... css/form.css
generate css/main.css
Your application has been created successfully under
/Webroot/demo
. The
webapp
command is used to create a brand new Yii web application. It takes just a single...
... Servlets and
JSPs 49
3.6 Adding Your Tomcat Web
Application 49
3.7 Java Servlets and JSPs 53
3.8 The ServletConfig and
ServletContext Classes 57
3.9 WebApplication Scopes 58
4 XML and XSLT: Xerces
and ... at
http://www.allaire.com/Products/JRun/
.
Many Web- application framework products also understand servlets and JSP.
Prominent among these are Netscape Application Server and iPlanet, Oracle
Application Server, BEA Weblogic, and Resin.
1.6 ... from the Command
Line 73
4.9 Zvon XSL Tutorial 73
4.10 Xerces and Xalan versus XT
and XP 73
4.11 JSP and XML Synergy 74
5 bonForum Chat Application:
Use and Design 77
5.1 Installing and Running
bonForum...
... remove this watermark.
49
3.6 Adding Your Tomcat Web Application
3.4.7 Help for Developing Tomcat Web Applications
A guide to developing Web applications for Tomcat is included with the distribution.
Be ... way.
3.6.1 Creating a Web Application
First, create a new folder, where you can put the files for the new Web application.
The name of this folder is TOMCAT_HOME\webapps\MyApp.
Next, copy and paste all ... server.xml file.
3.6.3 Editing the Web App Configuration
Now edit the Webapplication deployment descriptor, which is in the XML file
TOMCAT_HOME\webapps\MyApp \WEB- INF \web. xml.
You need to edit this...
... can and should—guide the definition
and design of the Webapplication itself.
Too often, the architectureand logic of an application determine its input and out-
put requirements. However, just ... command
host_executes_command (not needed)
host_executes_command_controls
host_executes_command_controls
host_executes_command_frame (not needed)
host_executes_command_ready
host_executes_command_ready
host_executes_command_robot ... guest_executes_command.jsp
BonForumRobot
guest_executes_command_robot.jsp
+ guest_executes_command.jsp
guest_executes_command_ready.jsp
bonCommand
guest_executes_command_controls.jsp
guest_executes_command_robot.jsp
Frame...
... What Drives the Web Application?
In Chapter 8, we will claim that the
BonForumEngine
servlet is in charge of the Web
application after all, it is the communication hub in the Web application. However,
viewed ... few
examples of host commands and guest commands.This is an obvious place to grow
this application in terms of both utility and user interest. Here are just a few of the
many possible candidates for addition ... “JSP:Tutorials.”
We also have all those Web links and more available for you on the BonForum
Project Web site,
http://www.bonforum.org
.
7.1.1 Getting Input from a WebApplication User
Of course, we will...
... other hand, a key purpose of JSP is to create dynamic Web pages that are
easily expandable and customizable.We see the design of bonForum as being a lot like
one of those new and empty land subdivisions ... ) > -1) {
// handle chatModerated
// handle chat item
else if(bonForumCommand.indexOf( “guest_executes_command” ) > -1) {
if(bonForumCommand.equals( “guest_executes_command” )) {
// not ... if(bonForumCommand.indexOf( “guest_executes_command_controls” ) > -1) {
➥
// handle chatMessagesPageSize
}
}
else if(bonForumCommand.indexOf( “host_executes_command” ) > -1) {
if(bonForumCommand.equals(...
... pathName
// (and equal to chatSubject)
nameAndAttributes = “sessionID_”;
nameAndAttributes += sessionId;
nameAndAttributes += “_”;
nameAndAttributes += creationTimeMillis;
nameAndAttributes ... for the chat Webapplication controlled by
BonForumEngine
, providing access to the data in the context of the application. This
includes methods to get data into and out of the XML, and methods ... visitor_joins_chat_controls.jsp.
That brought a new (and different) request to the
BonForumEngine
and to its
processRequest()
method. Its
boncommand
and, thus its
bonForumCommand
—value was
visitor_joins_chat_ready
,...
... see
that a deep understanding of tag libraries requires an understanding of the rest of JSP,
which requires an understanding of servlets.This is all very interesting, and all way
beyond the scope ... the
tag-handler classes.The
BonLogger
class just writes strings out to standard out, error
out, and a log file for each class.We certainly do not want a different log file for each
session. And there ... is only one
out
and one
err
. So, we want one static
BonLogger
instance per Tag Handler class, and it will be shared. It is thread-safe because
PrintWriter
,
System.out
, and
System.err
are...
... code into a custom tag handler.
Besides helping to simplify the JSP document and further the JSP objective of separat-
ing page design from dynamic content production and processing, replacing ... also from the
bean side, by reducing to one place (the tag handler class) some common and impor-
tant programming requirements, such as handling security or data validation.
10.7 Displaying the ... hoping that all the hype about XSLT and JSP would prove correct.We can
expect future bonForum versions to have page content created by Web designers,
using the tools and tags that we develop while...
... actions
and reduced bandwidth requirements with remote databases. Although our simple chat
application does not take full advantage of this design, an e-commerce application
based on the same architecture ... BonNodes in bonForum Web Chat
This is easier to see with an example. In the bonForum Web chat application, the
global nodes are the one and only root element (
bonForum
) and all three of its ... improvement in the speed and the memory usage of
the application. Using strings as we have previously creates many very large temporary strings and
buffers, and is thus expensive and inefficient.
11...
... bonForum Web
Application
C
C.1 Filename: TOMCAT_HOME\webapps\
bonForum \WEB- INF \web. xml
<?xml version=”1.0” encoding=”ISO-8859-1”?>
<!DOCTYPE web- app
PUBLIC “-//Sun Microsystems, Inc.//DTD Web ... sections.
\bonForum\installed\webapps\bonForum
This contains the bonForum Webapplication as installed in
TOMCAT_HOME\webapps.You should be able to see from these files how the files
in the source tree and webapp tree ... bonForum open source Web appli-
cation project, which is thoroughly discussed in this book. It is a prototype for a Web
chat application that is intended to test design concepts for Web applications...
... for bonForum Web Application
* (See chapter “Java Servlet and Java Bean - BonForumEngine and
BonForumStore”
* in the book: XML, XSLT, Java and JSP - A Case Study in Developing a Web
Application) .
*
* ... if(bonForumCommand.indexOf(“guest_executes_command”) > -1) {
//if(bonForumCommand.equals(“guest_executes_command”)) {
// not used yet
//}
//else
if(bonForumCommand.indexOf(“guest_executes_command_controls”) ... if(bonForumCommand.indexOf(“host_executes_command”) > -1) {
//if(bonForumCommand.equals(“host_executes_command”)) {
// not used yet
//}
//else
if(bonForumCommand.indexOf(“host_executes_command_controls”)...
... = “”;
if(nameAndAttributes == null) {
nameAndAttributes = “”;
}
int inx =
nameAndAttributes.trim().indexOf(‘ ‘);
if (inx > -1) { // space between name and
attributes
name =
nameAndAttributes.substring(0, ... www.verypdf.com to remove this watermark.
550
Appendix C Source Code for bonForum Web Application
// error, handle later
log(sessionId, “err”,
“outputForumChatMessages(), ERROR! NO timeMillis ... Split-Merge on www.verypdf.com to remove this watermark.
576
Appendix C Source Code for bonForum Web Application
str.append(“>”);
break;
}
case ‘&’: {
str.append(“&”);
break;
}
case...
... watermark.
618
Appendix C Source Code for bonForum Web Application
/** Gets bonforumStore, and outputTable with pathnames;
* gets iterator .and outputs first pathname.
*/
public void doInitBody( ... <code>command</code> attribute; also initializes
logging.
*
* @param value string to which <code>command</code> attribute is
set
*/
public void setCommand( String value ... watermark.
596
Appendix C Source Code for bonForum Web Application
str1 = allAttributes.substring(inx2); // remove all up through
name, equals and opening quote
String str2 = new String(str1);
//...