Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7731947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:36:30+00:00 2026-06-01T06:36:30+00:00

This is a not related to my project code , but a question came

  • 0

This is a not related to my project code , but a question came to my mind

This is my jsp page where there is a combination of Struts2 tags and scriptlet
which isn’t working and if i keep only the Scriptlet code its woring fine

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import = "java.util.ArrayList" %>
<%@ page import = "java.util.List" %>
<html>
<head>
<title>Struts 2 </title>

</head>
<body>


<s:form action="login" method="POST" >

<tr>
<td colspan="2">
Login
</td>
</tr>

<%
List list = (ArrayList)request.getAttribute("datareq");

for(int i=0;i<list.size();i++)
{
    System.out.println(list.get(i).toString());
}


%>

<s:submit value="Login" align="center"/>

</s:form>

</body>

</html>

my question is , cant we have both of them ??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:36:32+00:00Added an answer on June 1, 2026 at 6:36 am

    Of course you can use the two together. I assume this is just to demonstrate the point because there are better ways to iterate (the struts iterate tag and the jstl forEach tags), also it is extremely rare to scriptlets these days, that said…

    What you have provided works perfectly, but you should be aware…

    //This writes to CONSOLE (In my case the glassfish log)
    System.out.println(list.get(i).toString());
    
    //This writes to the response
    out.println(list.get(i).toString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is not programming related, but I have a scenario. Each video
This is not 100% programming related. But I think this is somewhat useful because
This is not exactly homework but it is related to my studies: A grammar
First of all: This question is not directly programming related. However, the problem only
This question is related to Java Refuses To Start - Could Not Resrve Enough
I have a question which is not really related to android. but because i'm
May be this question a bit not for StackOverflow, but both compilers and Verilog
I believe this is a WCF question, but perhaps it's also related to Azure.
This is not really a technical programming question, but has more to do with
This is a separate question, but it is related to an earlier question: Three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.