Get the App
SLTechnology News&Howtos  ›  Development  › 

How to create JSP pages by MyEclipse developer JSF

Shulou Source: shulou.com Published: 2022-06-02 12:32:17 10月05日 Update

This article is about how MyEclipse developer JSF creates JSP pages. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

In the MyEclipse development JSF, create two JSP pages, one is the user login page, the other is the login success page. The two pages are loginUser.jsp and loginUserSuccess.jsp respectively. In order to make the application simple, if there is an exception in login, we will return the loginUser.jsp page without adding any verification. We can create a JSP page through the faces-config.xml file. Click the JSP button shown in the figure to create a userLogin.jsp page, and the JSP creation wizard appears.

MyEclipse developer JSF figure 1

Figure 5.1: Creating userLogin.jsp using the faces-config.xml editor

Create userLoginSuccess.jsp pages in the same way

MyEclipse development JSF figure 2

Figure 5.2: Creating userLoginSuccess.jsp using the faces-config.xml editor

Next, edit the userLogin.jsp page

MyEclipse development JSF figure 3

Figure 5.3: Begin editing the userLogin.jsp page

MyEclipse JSP Designer can use Source mode, Design mode, Design/Source mode to edit JSP files. Design/Source is used in this Demo, as shown in the figure:

MyEclipse developer JSF figure 4

Figure 5.4: Switched to Design/Source mode and expanded JSF palettes

Next we need to add the following code to the page:

Add a h:inputText component to the user name

Add a h:inputSecret component to the password

Add user name input box h:outputLabel

Add password input box h:outputLabel

At the same time, the page should use our own MessageBundle.

MyEclipse development JSF figure 5

Figure 5.5: Remove template text and add our MessageBundle to the JSP page

Thank you for reading! This is the end of this article on "how to create a JSP page in MyEclipse development JSF". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Page development mode user login next two content password file more user name article component such as figure input good practical success code Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei OPPO Reno Shulou Information macOS Xiaomi