introduction JSF part 3 : Configuring and Running the Application

July 30, 2008 at 12:01 am (Uncategorized)

Set the IDE to display greeting.jsp when it runs the application and, finally, test the application.

  1. In the Projects window, right-click the project node and choose Properties.
  2. Click the Run node and type /faces/greeting.jsp in the Relative URL field. This allows you to specify the entry point for the application in the IDE. Click OK.
  3. Right-click the project node and choose Run (F6). The IDE builds the project, starts the application server, deploys the application, and shows the following page in the default external browser:

When you click the Submit button, you see the following:

Note: Because you have changed the entry point for the application to greeting.jsp, you can now delete welcomeJSF.jsp, which was generated by default when the project was created. The page is not required for this tutorial, nor follow-up tutorials.

Read the rest of this entry »

Permalink Leave a Comment

Introduction JSF part 2:Creating the JSP Pages

July 28, 2008 at 10:40 am (programming)

Create a new JSP page called greeting.jsp that welcomes the user and collects his or her information. Then create a success.jsp page that congratulates the user in response to receiving data from the form.

Creating the Greeting Page

  1. In the Projects window, right-click the project node and choose New > JSP. Name the file greeting. Make sure the JSP File (Standard Syntax) option is selected and click Finish. The IDE creates the new JSP file and opens it in the Source Editor. Also, note that the file is added to the Web Pages node in the Projects window.
  2. In the Source Editor, declare the JSF tag libraries in greeting.jsp. Do this by adding the following code to the top of the file:
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

    Note that you can make use of the IDE’s built-in support for code completion. As you type, press Ctrl-Space to list suggestions based on the context. In this manner, code completion can help you add tag names and attributes, such as the URIs of the tab libraries.

  3. Change the contents of both the title and h2 tags to Welcome to jAstrologer.
  4. Now add a JSF form to the file. In the Palette (Ctrl-Shift-8), expand the JSF category. You can drag-and-drop items from the Palette directly into the Source Editor. Click the JSF Form button, drag the item to a point below the h2 tags, and release the mouse button. In the dialog box that displays, leave Empty Form selected and click OK. The IDE fills in the following code (shown in bold):
    <h2>Welcome to jAstrologer</h2>
    
    <f:view>
        <h:form>
        </h:form>
    </f:view>
  5. You can use inputText components to get user input and a commandButton component to submit the form. In the Source Editor, change the contents of the <h:form> tags to the following (changes in bold):
    <f:view>
        <h:form>
            <p>Enter your name: <h:inputText value="name" /></p>
            <p>Enter your birthday: <h:inputText value="birthday" /></p>
            <h:commandButton value="Submit" action="submit" />
        </h:form>
    </f:view>

    To format your code, right-click in the Source Editor and choose Format (Alt-Shift-F)

Creating the Success Page

  1. Now create a JSP page that says ‘Congratulations’.
  2. Create a new JSP file as described above. Name the file success.
  3. Change the contents of the file to the following:
—————————————————————–
<head> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<title>Congratulations</title>
</head>
<body> <h2>Congratulations</h2>
<p>You’ve successfully registered with jAstrologer.</p>
</body>
——————————————————————

Permalink Leave a Comment

Introduction part 1 : Creating a Web Application with the JSF Framework

July 26, 2008 at 12:28 am (programming)

You can add JSF support to existing web applications that are opened in the IDE, or to any new projects. The GlassFish server already includes the JSF libraries, so you do not need to download or install them in the application server. In this example, you add JSF support while creating a new web application project.
Choose File > New Project (Ctrl-Shift-N) to open the New Project wizard. Under Categories select Web; under Projects select Web Application. Click Next.
Name the project jAstrologer, specify a location for the project on your computer, then click Next.
In the third step of the wizard, named Server and Settings, set the server to GlassFish V2, set the Java EE Version to Java EE 5, and click Next.
Select the JavaServer Faces option and click Finish.

Read the rest of this entry »

Permalink Leave a Comment

“UNIX Trojan Horses”

June 29, 2008 at 11:15 pm (programming)

Introduction
————

“UNIX Security” is an oxymoron. It’s an easy system to brute force hack (most UNIX systems don’t hang up after x number of login tries, and there are a number of default logins, such as root, bin, sys and uucp). Once you’re in the system, you can easily bring it to its knees (see my previous Phrack article, “UNIX Nasty Tricks”) or, if you know a little ‘C’, you can make the system work for you and totally eliminate the security barriers to creating your own logins, reading anybody’s files, etcetera. This file will outline such ways by presenting ‘C’ code that you can implement yourself.

Requirements
————
You’ll need a working account on a UNIX system. It should be a fairly robust version of UNIX (such as 4.2bsd or AT&T System V) running on a real machine (a PDP/11, VAX, Pyramid, etc.) for the best results. If you go to school and have an account on the school system, that will do perfectly.
Notes
—–
This file was inspired an article in the April, ’86 issue of BYTE entitled “Making UNIX Secure.” In the article, the authors say “We provide this information in a way that, we hope, is interesting and
useful yet stops short of being a ‘cookbook for crackers.’ We have often intentionally omitted details.” I am following the general outline of the article, giving explicit examples of the methods they touched
on.

An unrelated note: Somewhere there’s a dude running around using the handle “Lord British” (not THE Lord British…). This is a message for LB: “Fuck off and die.”

Here we go…

Project One: Fishing For Passwords
———————————–

You can implement this with only a minimal knowledge of UNIX and C. However, you need access to a terminal that many people use – the computer lab at your school, for example.

When you log onto a typical UNIX system, you see something like this:

Tiburon Systems 4.2bsd / System V (shark)

login: shark
Password: (not printed)

The program I’m giving you here simulates a logon sequence. You
run the program from a terminal and then leave. Some unknowing fool will walk up and enter their login and password. It is written to a
file of yours, then “login incorrect” is printed, then the fool is
asked to log in again. The second time it’s the real login program.
This time the person succeeds and they are none the wiser. Read the rest of this entry »

Permalink 2 Comments

“Introduction to Videoconferencing”

June 29, 2008 at 10:44 pm (techno)

Videoconferencing is not just one thing. It takes several different forms and
can be designed in many different ways. Most of these ways are probably still
waiting to be discovered.

First of all, there are two main categories of videoconferencing. There is
Point-to-Point and Point-to-Multipoint.

Point-to-point/Two-Way Videoconferencing
—————————————-
Two-way videoconferencing enables people to conduct meetings even though the
participants are in separate locations. Using interactive video and audio
equipment, participants in one location can see, hear, and interact with
colleagues in another location.

The most familiar example occurs regularly on TV. When a newscaster in
Washington interviews a head of state on the opposite side of the world
“live,” that’s point-to-point, full-motion, full-color videoconferencing. Read the rest of this entry »

Permalink Leave a Comment

Follow

Get every new post delivered to your Inbox.