简体   繁体   English

如何在scriplet标签中获取jsp页面的某些组件的值?

[英]How can get value of some component of jsp page in scriplet tag?

I am setting 'Id' in a hidden field. 我在隐藏字段中设置了“ Id”。 what should I do to get this value in Scriptlet? 我应该怎么做才能在Scriptlet中获得此值?

I have this field 我有这个领域

<html:hidden name="ConfigForm" property="ConfigId" styleId="ConfigId"/> 

i want this field's value in my scriptlet which has some line of code like this 我想在我的scriptlet中具有此代码行的字段值

<% Integer ConfigId =1;
  ConfigDTO = getConfig(ConfigId, null); %> 

For now im passing hardcoded ConfgiId but I need to replace it with hidden field value. 目前,我正在传递硬编码的ConfgiId,但我需要将其替换为隐藏字段值。

EDIT 编辑

Maybe you can try this (assuming ConfigId is a java.lang.Integer): 也许您可以尝试一下(假设ConfigId是java.lang.Integer):

<jsp:useBean id="configId" class="java.lang.Integer"/>  
<bean:write name="configId" property="ConfigId"/>  

<%  
  ConfigDTO = getConfig(configId, null);
%>

Also, you would need to add the bean taglib declarations if you still haven't got it: 另外,如果还没有,则需要添加bean taglib声明:

<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM