如何从保存在 ROOT\WEB-INF\classes 路径中的自定义 JSP 接收数据

发布于 2024-12-20 16:31:56 字数 849 浏览 2 评论 0原文

我通过使用内部的portal-ext.properties修改了Liferay页面的静态页面 D:\Liferay\Liferay Tomcat\liferay-portal-6.1.0-ce-b4\tomcat-7.0.22\webapps\ROOT\WEB-INF\classes

**portal-ext.properties

auth.login.community.url= /Test.jsp**

这个特定的 Test.jsp 保存在路径下 D:\Liferay\Liferay Tomcat\liferay-portal-6.1.0-ce-b4\tomcat-7.0.22\webapps\ROOT

这是我的 Test.jsp 页面

<form method="POST" action="/MyActionclass">
    Enter your name:</font><input type="text" name="username" size="20"></p>
    Enter your password:</font><input type="text" name="password" size="20"></p>
</form>

这工作正常,自定义页面已加载。

请告诉我,在哪里配置这个MyActionclass才能接收JSP提交的数据?

我的要求是,一旦在 MyActionclass 中验证了用户名和密码(现在已硬编码),我将显示我开发的 portlet。

I have modified the static page of the Liferay Page by using portal-ext.properties inside
D:\Liferay\Liferay Tomcat\liferay-portal-6.1.0-ce-b4\tomcat-7.0.22\webapps\ROOT\WEB-INF\classes

**portal-ext.properties

auth.login.community.url=/Test.jsp**

This Particular Test.jsp is kept under path
D:\Liferay\Liferay Tomcat\liferay-portal-6.1.0-ce-b4\tomcat-7.0.22\webapps\ROOT

This is my Test.jsp page

<form method="POST" action="/MyActionclass">
    Enter your name:</font><input type="text" name="username" size="20"></p>
    Enter your password:</font><input type="text" name="password" size="20"></p>
</form>

This works fine, custom page is loaded.

Please tell me, where to configure this MyActionclass so that it will receive the data submitted from the JSP?

My requirement is that, once the username and password are validated inside the MyActionclass (Hardocded as per now), I will display my portlets developed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小糖芽 2024-12-27 16:31:56

我建议您使用 Liferay 6 Plugins-SDK 为您的解决方案创建一个自定义 Portlet。然后您可以使用标准的 Portlet 架构来处理身份验证等。

同样,您可以使用 Liferay 的登录 portlet 来对用户进行身份验证。

无论哪种方式,您都需要将成功登录后要显示的 portlet 的权限设置为不具有来宾“查看”权限,并确保分配给登录用户的角色具有“查看”权限。这将对任何未经 Liferay 身份验证的用户隐藏它们。

如果您查看有关 的 Wiki 帖子Liferay Plugins-SDK 您可以开始创建您自己的 portlet(如果您还没有这样做)。

希望这有帮助!

I would suggest that you create a custom Portlet using the Liferay 6 Plugins-SDK for your solution. Then you can just use the standard Portlet architecture to handle the authentication etc.

Equally you can just use Liferay's login portlet to authenticate users.

Either way you'll need to set permissions on the portlets you want to display after successful login to not have Guest "View" permissions, and make sure that the Role assigned to Logged in users has "View" permissions. This will hide them from any non Liferay authenticated user.

If you look at the Wiki post about Liferay Plugins-SDK you can get started with creating your own portlet (if you haven't done so already).

Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文