Apologies for the OT post.

Jay

Can i ask how your experience of using JSP has been. Its something i'm
considering as i have a working
knowledge of java. However from what i have seen so far, for the kind of web
based applications i build
coldfusion enables me to get the job done quicker and easier. I Just
wondered if you found any significant advantages
to using it (apart from it bieng cross platform and able to use existing
Java classes).

Also any disadvantages to using it as an alternative to coldfusion i would
be interested in.

I have heard that using EJBs makes it easier to seperate business logic from
presentation?

Thanks in advance

Kola
-----Original Message-----
From: Jay Jennings [mailto:[EMAIL PROTECTED]]
Sent: 02 April 2001 19:45
To: Fusebox
Subject: RE: JSP fusebox (was RE: Decrypting tags)


> so what did your index.jsp look like?

Here's a little chunk:

<!-- dpi.cfm for DentalPlanInfo.com -->
<%@ page language= "java"%>
<%@ page import="java.util.*"%>
<%! String fa;  %>
<%! String pagename;  %>

<%
        fa = request.getParameter("fa");
        if (fa == null)
                fa = "plan";

        if (fa.equals("plan"))
                {
                %>
                <jsp:include page="dsp_plan.jsp" flush="true"/>
                <%
                }
        else if (fa.equals("mailmemberinfo"))
                {
                %>
                <jsp:include page="act_sendmembermail.jsp" flush="true"/>
                <jsp:include page="dsp_memberthanks.jsp" flush="true"/>
                <%
                }
        else
                {
                %>
                Define this fuseaction: [<%= fa %>]<br>
                <%
                }
%>
<jsp:include page="dpilogonav.jsp" flush="true"/>


Notice that I used if/else instead of switch/case. That's because in java
(as in C and other languages) switch/case only takes integers as values. So
I could have made all my fuseactions numeric and just remembered that 4 was
"mailmemberinfo" but I don't like to have to remember that much stuff. :)

Another way to handle that would be to create a 2-element array holding the
fuseaction words and matching numbers at the top of the file, and then
lookup the number you need to use in the switch/case block. An if/else block
creates more of a hit than switch/case, but adding a lookup would increase
the code necessary to get the job done, too, so I just decided to go the
route shown above.

Also, this was the first jsp app that I wrote, so anything you see could
probably be written better. =:)

 ..jj..

 - - - - -
Get your free email account: [EMAIL PROTECTED]
Sign up at http://www.alakazam.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to