17 to 20: Java Learning: Struts – a rant

I have lost in Java's servlet. There are so many things to learn and I do not have good books. SL 314 book is not enough for me. That have some theory part but not good in practical. Also Java strict typing is creating problem. Everything is object is also a big trouble for me.

I have lost the sequence because I have not posted many posts due to time. After 16th hour, I got some dose of Struts, and few basic Actions in Struts.


Pic from netbeans

First App:

Page: WelcomeStruts.jsp

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<html:html lang="true">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="welcome.title"/></title>
    <body style="background-color: white">
        <logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">
            <div  style="color: red">
                ERROR:  Application resources not loaded -- check servlet container
                logs for error messages.
        <h3><bean:message key="welcome.heading"/></h3>
        <p><bean:message key="welcome.message"/></p>
        <html:link page="/First.do">First Page</html:link>


    Document   : First
    Created on : Oct 14, 2010, 10:32:59 PM
    Author     : satya
<%@taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <h1>Hello World!</h1>
        First page
        <html:link page="/Welcome.do">Go to Welcome</html:link>


        <action path="/Welcome" forward="/welcomeStruts.jsp"/>
        <action path="/First" forward="/First.jsp" />

Action-mappings node was there. I have added action path=/First.jsp.



  • # 1 - by Convert To CSV

    I’ve been reading about this on a couple of other web sites, but you without a doubt expained this perfectly. Thanks a ton!

Comments are open for an year period. Please, write here on Facebook page.