Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<module>todolist-goof</module>
<module>log4shell-goof</module>
</modules>
<packaging>pom</packaging>
<comment>test</comment>
<packaging>pom</packaging>


<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,50 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package io.github.benas.todolist.web.action;

import com.opensymphony.xwork2.ActionSupport;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
* Action class to redirect to about page.
*
* @author Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
*/
public class AboutAction extends ActionSupport {

public static final String ACTIVE = "active";

private String feedback;

public String getAboutTabStyle() {
return ACTIVE;
}

public String getFeedback() {
return feedback;
}

public void setFeedback(String feedback) {
this.feedback = feedback;
}

public String execute() throws Exception {
if (feedback != null) {
searchFeedback(feedback);
}
return SUCCESS;
}

private ResultSet searchFeedback(String keyword) throws Exception {
Connection connection = DriverManager.getConnection(
"jdbc:h2:mem:todolist", "sa", "");
Statement statement = connection.createStatement();
String sql = "SELECT * FROM feedback WHERE comment = '" + keyword + "'";
return statement.executeQuery(sql);
}
}