"/>

在servlet中获取动态添加的表值(Get the dynamically added table values in servlet)

我有我的jsp文件类似于以下内容:

<table>
<tr class="schedule">
    <td><input type="text" name="fromDate"</td>
    <td><input type="text" name="toDate"</td>
    <td>
        <table>
            <tr class="fromTime">
                <td>
                    <input type="text" name="fromHour"/>
                </td>
            </tr>
        </table>
    </td>
    <td>
        <table>
            <tr class="toTime">
                <td>
                    <input name="toTime"/>
                </td>
            </tr>
        </table>
    </td>
    <td>
        <table>
            <tr>
                <td>
                    <input name="amount"/>
                </td>
            </tr>
        </table>
    </td>
</tr>
<tr class="totalAmount">
    <td><input type="text" class="totAmount"</td>
<tr>
</table>

新的计划行被动态添加,对于每一个,可以有来自TimetoTime表的no.of。 我需要在我的servlet中获取这些值。 我知道我可以获得fromDatetoDate的值

String[] fromDates=request.getParameterValues("fromDate");
String[] toDates=request.getParameterValues("toDate");

我想知道如何从fromDatetoDate中检索fromHourtoHour值。

提前致谢。


I have my jsp file similar to the following:

<table>
<tr class="schedule">
    <td><input type="text" name="fromDate"</td>
    <td><input type="text" name="toDate"</td>
    <td>
        <table>
            <tr class="fromTime">
                <td>
                    <input type="text" name="fromHour"/>
                </td>
            </tr>
        </table>
    </td>
    <td>
        <table>
            <tr class="toTime">
                <td>
                    <input name="toTime"/>
                </td>
            </tr>
        </table>
    </td>
    <td>
        <table>
            <tr>
                <td>
                    <input name="amount"/>
                </td>
            </tr>
        </table>
    </td>
</tr>
<tr class="totalAmount">
    <td><input type="text" class="totAmount"</td>
<tr>
</table>

New schedule rows get dynamically added and for each of this, there can be no.of fromTime and toTime tables. I need to get these values in my servlet. I know I could get the values of fromDate and toDate through

String[] fromDates=request.getParameterValues("fromDate");
String[] toDates=request.getParameterValues("toDate");

I am looking to find out how I can retrieve fromHour and toHour values corresponding to its fromDate and toDate.

Thanks, in advance.


原文:https://stackoverflow.com/questions/26462673
2023-08-16 10:08

满意答案

一种方法是这样的:

public void startProgress(){

   //make the image visible
   imagView.setVisibility(ImageView.VISIBLE);

   //start a handler that will wait for 2000ms and then make the img invisible
   Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                imagView.setVisibility(ImageView.INVISIBLE);
            }
        }, 2000);
}

One way of doing it would be like this:

public void startProgress(){

   //make the image visible
   imagView.setVisibility(ImageView.VISIBLE);

   //start a handler that will wait for 2000ms and then make the img invisible
   Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                imagView.setVisibility(ImageView.INVISIBLE);
            }
        }, 2000);
}

相关问答

更多

更改Gridview项目的可见性(Change Gridview item visibility)

在您的自定义适配器类中,查看getView()方法,您可以在其中将GONE或VISIBLE或INVISIBLE值设置为tPrice TextView或任何视图(如果需要)。 i solved my problem. I had set the adapter again. This way may be a bad way but its work :)

如何使用sleep更改ImageView的可见性(How to change visibility of ImageView with sleep)

一种方法是这样的: public void startProgress(){ //make the image visible imagView.setVisibility(ImageView.VISIBLE); //start a handler that will wait for 2000ms and then make the img invisible Handler handler = new Handler(); handler.postD...

根据结果更改Alertdialog的Imageview(Change Imageview of Alertdialog as per the result)

我建议你扩展DialogFragment.class ,在那里扩充你的布局并与你交流Activity或Fragment public class FingerprintDialog extends AppCompatDialogFragment implements View.OnClickListener { private DialogFingerprintBinding binding; private Listener listener; @Override public void on...

Android动画可见性同时更改两个视图(Android animate visibility change for two views at once)

由于您没有发布布局,如果您可以将ViewPager和LinearLayout放在一个布局中(例如在RelativeLayout内),那么您可以为其设置动画。 Since you didn't post your layout, if you can put your ViewPager and LinearLayout in one layout, (for example inside a RelativeLayout) then you can animate that.

更改按钮可见性(Change Button Visibility)

像这样更改你的按钮xml: <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Administrator" android:id="@+id/button2" android:layout_below="@+id/button" android:onClick="o...

如何在Android studio中将GONE可见性更改为VISIBLE可见性(how to change a GONE visibility to VISIBLE visibility in android studio)

是.. ch = (CheckBox)findViewById(R.id.checkbox); ch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) { if(isChec...

在动画之前影响了Imageview可见性(Imageview visibility affected before animation)

请试试这个: - public class Anim1Foto implements Animator.AnimatorListener { private ImageView imagen1; private ImageView imagen2; public Anim1Foto (ImageView pimagen1,ImageView pimagen2){ this.imagen1 = pimagen1; this.imagen2 = pimagen2; }...

使用onmouseover / onmouseout更改可见性(change visibility with onmouseover / onmouseout)

尝试使用不透明度 node.style.opacity=0; 要么 node.style.display='none'; try using opacity node.style.opacity=0; or node.style.display='none';

在片段和活动之间进行委托,但未触发可见性更改(Delegate between fragment and Activity called but visibility change not triggered)

您正在fragment.createView中设置委托您还使用ViewPager来处理处理其生命周期的片段。 因此,每次寻呼机创建新片段时,都会替换活动中的代理。 查看寻呼机和片段生命周期 这显示了如何确定当前可见的片段。 You are setting the delegate in fragment.createView You are also using ViewPager to handle the fragments which handles their lifecycle. So ...

以编程方式更改imageView的颜色(Change colour of imageView programmatically)

为什么要设置根视图的background 。 只是这个声明会起作用: ImageView someView = (ImageView) findViewById(R.id.lifeSquare); someView.setBackgroundColor(Color.parseColor("#ffffff")); 关心 : 还有一点是,您的imageView具有invisible : android:visibility="invisible" 为什么要为imageview设置不可见属性? Wh...

相关文章

更多

如何定时执行servlet

请问谁知道有什么方法可以定时执行servlet ,除页面标签方法、web.xml配制方法 除外。还有没 ...

jquery与servlet交互的json问题

框架用烦了,目前只用servlet和jquery,servlet返回json数据,jquery在前面无 ...

table-Oceanus配置说明

作用: 描述具体的表规则 属性: name – 声明 table 名字,当命中 sql 中的 tabl ...

Guava集合工具类-Table接口映射处理

System.out.println("Emp&nbsp

关于JSP 、 Servlet中文乱码问题, 方法差不多试完了 还是不行- -!

JSP页面1: &lt;table border=&quot;1&quot;&gt; &lt;%@ ...

js 怎么传递数组参数到servlet?

js: function addItem() { with (document.getElemen ...

请问怎么applet怎么通过servlet连接数据库

请问怎么applet怎么通过servlet连接数据库。请各位大侠给个例子学习一下。万分感谢! ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本